PDA

View Full Version : crontab



alin19
4th September 2008, 07:33 AM
my crontab isn't working anymore, i was using crontab -e to edit it
but the lines here are not executed anymore

#mount
00 09 * * 1-5 mount /opt/mnt
31 09 * * 1-5 umount /opt/mnt

#preluare date
20 09 * * 1-5 /etc/init.d/market_watch_cache start; cd /opt/lampp/htdocs/spartacus/spartacus/tickers_xml_dir; chown -R nobody:root last_changes.log
#tickers

25 09 * * 1-5 /etc/init.d/tickind start


00 09 * * 2-6 /opt/lampp/bin/php /opt/lampp/htdocs/spartacus/included/crond2.php
41 16 * * 1-5 /opt/lampp/bin/php /opt/lampp/htdocs/spartacus/included/crond.php

knesenko
4th September 2008, 02:47 PM
Hi.You forgot to add * in cron format.This is a cron format.Read this
http://www.nncron.ru/help/EN/working/cron-format.htm

Evil_Bert
4th September 2008, 03:57 PM
A few things to check ...

- Make sure the permissions are 0644.
- For the system crontab (i.e. /etc/crontab) check that the security context is system_cron_spool_t ("Cron data" in the GUI file properties). I'm not sure what the context should be for a user crontab.
- Crontab files cannot be symlinks or be linked to.
- Check your allow/deny files: if only cron.deny exists and is empty, all users can use crontab. If neither cron.allow nor cron.deny exists, only the root user can use crontab.
- If it's the system crontab, the file needs to be owned by root and you need the username between the date/time fields and the command.
- If it's a user crontab, the user should own it (but the format looks OK).
- Have a look at file /var/log/cron to see what's logged - may or may not be helpful.

Note: I haven't gone through the crontab file with a fine tooth comb.


Hi.You forgot to add * in cron format.This is a cron format.Read this
http://www.nncron.ru/help/EN/working/cron-format.htmThat's a different version - Fedora uses ISC Cron, a.k.a. Vixie Cron, which still has five date/time fields, not six.

See this for more:
man 5 crontab

knesenko
4th September 2008, 04:00 PM
A few things to check ...

- Make sure the permissions are 0644.
- For the system crontab (i.e. /etc/crontab) check that the security context is system_cron_spool_t ("Cron data" in the GUI file properties). I'm not sure what the context should be for a user crontab.
- Crontab files cannot be symlinks or be linked to.
- Check your allow/deny files: if only cron.deny exists and is empty, all users can use crontab. If neither cron.allow nor cron.deny exists, only the root user can use crontab.
- If it's the system crontab, the file needs to be owned by root and you need the username between the date/time fields and the command.
- If it's a user crontab, the user should own it (but the format looks OK).
- Have a look at file /var/log/cron to see what's logged - may or may not be helpful.

Note: I haven't gone through the crontab file with a fine tooth comb.

That's a different version - Fedora uses ISC Cron, a.k.a. Vixie Cron, which still has five date/time fields, not six.

See this for more:
man 5 crontab


Ok thanks for information:)