New servers

General discussion about Defcon

Moderator: Defcon moderators

User avatar
(MOR)
level5
level5
Posts: 2799
Joined: Sat Jul 28, 2007 9:00 pm
Location: Morocco
Contact:

Postby (MOR) » Mon Jan 07, 2013 8:35 pm

Can you copy past just a part of what you whrite in the crontab ?
User avatar
trickser
level5
level5
Posts: 1826
Joined: Thu Mar 06, 2008 2:15 pm
Location: The Senate ; GMT+1
Contact:

Postby trickser » Mon Jan 07, 2013 8:41 pm

Nice work. Never understood MORs cron approach anyway.
User avatar
(MOR)
level5
level5
Posts: 2799
Joined: Sat Jul 28, 2007 9:00 pm
Location: Morocco
Contact:

Postby (MOR) » Mon Jan 07, 2013 8:58 pm

trickser wrote:Nice work. Never understood MORs cron approach anyway.


It's very simple, that is a simple example of making a directory


In the cron tab we write :

Code: Select all

1 1 7 * * /hightasks/mkdir1v1/7
it mean to run the file 7 in the folder "hightasks" and the subfolder "mkdir1vs1" at 1:01 AM

In the file 7 we write :

Code: Select all

mkdir /var/www/vhosts/highlatency.net/httpdocs/hl/DEFCON\ 1vs1/Tournament\ Matchups\ Mode\ 1/2013/January/7
it mean here by runing that file we will make the folder 7 in January at 1:01 GMT+1 mean midnight GMT
User avatar
Laika
Site Admin
Posts: 1514
Joined: Tue Feb 07, 2012 7:16 pm
Location: Moscow

Postby Laika » Mon Jan 07, 2013 9:04 pm

Thanks. (MOR), it was a simple file with paths to scripts; it looked like this (I already deleted original, easy to make a new one):

Code: Select all

* * * * * /var/www/html/2
* * * * * /root/servers/servername/script-to-zip-and-more-recs


I tried to crontab scripts like:

Code: Select all

* * * * * echo It works !
#

Code: Select all

* * * * * echo It works !


Code: Select all

* * * * * echo it works !




All without success. Tried to put same stuff in /etc/crontab, restarted it (cd /etc ; crontab stop ; crontab start). There were no error messages, and when used scripts 'standalone', they worked OK.
User avatar
trickser
level5
level5
Posts: 1826
Joined: Thu Mar 06, 2008 2:15 pm
Location: The Senate ; GMT+1
Contact:

Postby trickser » Mon Jan 07, 2013 9:14 pm

^to edit crontabs you should use the crontab command, me thinks, it will tell cron to reread it and it will take care on permissions. Just editing the crontab doesnt work. Also echo doesnt have an effect like this in cron, cron runs in background and echos wont just appear on a shell you are just using.

Code: Select all

echo "Hello World $(date)" >> /tmp/crontest.txt

redirects it to a location where you can find it.
(MOR) wrote:
trickser wrote:Nice work. Never understood MORs cron approach anyway.


It's very simple, that is a simple example of making a directory

I mean, I dont understand why you would use cron. Cron is an alarm clock, doing things at specific times. But all you wanna do is to handle some files when they appear. And you know exactly when they appear, thats when a game ended, dedcon shuts down and the server loop is about the start a new server. I would put everything in the server loop, unless there is a good reason not to.
Last edited by trickser on Mon Jan 07, 2013 9:40 pm, edited 2 times in total.
User avatar
(MOR)
level5
level5
Posts: 2799
Joined: Sat Jul 28, 2007 9:00 pm
Location: Morocco
Contact:

Postby (MOR) » Mon Jan 07, 2013 9:27 pm

trickser wrote:^to edit crontabs you should use the crontab command, me thinks, it will tell cron to reread it and it will take care on permissions. Just editing the crontab doesnt work.
(MOR) wrote:
trickser wrote:Nice work. Never understood MORs cron approach anyway.


It's very simple, that is a simple example of making a directory

Cron is an alarm clock, doing things at specific times...


And for that I use it to run some files in a specific times and like that I work.. Because for me I never was a Linux user and then I did my best to do my work properly with a simple way.
User avatar
trickser
level5
level5
Posts: 1826
Joined: Thu Mar 06, 2008 2:15 pm
Location: The Senate ; GMT+1
Contact:

Postby trickser » Mon Jan 07, 2013 9:34 pm

It obviously works your way and therefor its all right. But as usually I have to warn people about copying the MOR way. :P
User avatar
(MOR)
level5
level5
Posts: 2799
Joined: Sat Jul 28, 2007 9:00 pm
Location: Morocco
Contact:

Postby (MOR) » Mon Jan 07, 2013 9:42 pm

Hahaha, shame

There is no bor on it :P
User avatar
Forever Young
level5
level5
Posts: 1440
Joined: Tue Dec 16, 2008 9:48 pm
Location: Black Forest Germany GMT+1

Postby Forever Young » Tue Jan 08, 2013 1:12 am

trickser wrote:It obviously works your way and therefor its all right. But as usually I have to warn people about copying the MOR way. :P

:lol:

Hahaha, shame
There is no bor on it

Laika didn`t ask for work against boredom. :lol:

All praises for these guys ranking:

1. bert_the_turtle
2. Senator
3. MOR/Laika
4. Ace Rimmer

:P :roll:
WeAreDefconBastardsNotTerrorists

Let's dance in style
let's dance for a while
heaven can wait
we're only watching the skies
hoping for the best
but expecting the worst
are you gonna drop the bomb or not?
...

Return to “General”

Who is online

Users browsing this forum: No registered users and 10 guests