Closed GoogleCodeExporter closed 8 years ago
IS the problem an issue with simple having a command on more than one line???
If so, how to write the above on
one line?
Original comment by bac...@gmail.com
on 24 Jun 2009 at 2:32
You'll definitely have to keep the command on a single line. If you need a
structured script (like you seem to do)
it's best to put it in a file and call that script from a cron command. If your
command is not too long you can also
concatenate the parts with ";" (execute parts regardless of success) or "&&"
(only keep going if the previous part
was successful).
Hope that helps,
Sven
Original comment by sven.a.s...@gmail.com
on 24 Jun 2009 at 6:44
[deleted comment]
Thanks Sven
I can save now and it works when I click 'Run Now'
However, it doesn't seem to run 'by itself'.
If I want my command to run every other minute then isn't the correct setting
*/2 * * * *
??
Original comment by bac...@gmail.com
on 24 Jun 2009 at 8:57
That is correct (provided the 'Minute' column is the first one). You might want
to confirm if cron is working in
principle by setting a simpler schedule (like an explicit time) and see if that
works. Also, check in Terminal if
your cron daemon is running:
[eris:~] sas% ps aux | grep cron
root 4472 0.0 0.0 76480 652 ?? Ss 3:30PM 0:00.01
/usr/sbin/cron
sas 4523 0.0 0.0 75492 420 s005 R+ 3:31PM 0:00.00 grep cron
You must have the line beginning with 'root' or else no jobs will be executed.
-sas
Original comment by sven.a.s...@gmail.com
on 26 Jun 2009 at 1:32
[deleted comment]
Thanks Sven
Yes crontab is installed, but I'm wondering if the SETUID bit set is incorrect.
My permissions are -r-sr-sr-x. How to change so they are correct?
Original comment by bac...@gmail.com
on 26 Jun 2009 at 2:15
Not sure which file you were looking at but either way, +s looks off. I've got:
[eris:~] sas% ls -l /usr/sbin/cron
-r-xr-xr-x 1 root wheel 90800 May 31 2008 /usr/sbin/cron
[eris:~] sas% sudo ls -l /var/at/tabs/
total 4
-rw------- 1 root wheel 236 Jun 26 16:18 sas
Original comment by sven.a.s...@gmail.com
on 26 Jun 2009 at 2:20
ok very close
used chmod -R +rw /usr/bin/crontab
and get
-rwsr-sr-x
but think should be
-rwsr-xr-x
Original comment by bac...@gmail.com
on 26 Jun 2009 at 2:30
Ah, you're looking at *crontab*, that is:
[eris:~] sas% ls -l /usr/bin/crontab
-r-sr-xr-x 1 root wheel 73648 May 31 2008 /usr/bin/crontab
as you say (minus 'w').
Original comment by sven.a.s...@gmail.com
on 26 Jun 2009 at 2:33
Original comment by sven.a.s...@gmail.com
on 3 Nov 2010 at 10:47
Original issue reported on code.google.com by
bac...@gmail.com
on 22 Jun 2009 at 12:15