Portál AbcLinuxu, 6. května 2025 20:34
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
50 * * * * root cd / && run-parts --report /etc/cron.hourly
57 1 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
45 1 * * 5 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
21 3 26 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
20 4 */2 * * /usr/bin/sa-update --no-gpg &> /dev/null
0 0 * * * /usr/local/sbin/quota_notify &> /dev/null
30 4 */2 * * /usr/local/sbin/sa_rules_update.sh &> /dev/null
58 10 * * * cd /root/backup ; ./backup.pl > /var/log/zalohovani/klient`date +%d.%m.%Y`.txt
Řešení dotazu:
1.) 58 10 * * *
/usr/bin/perl /root/backup/backup.pl
> /var/log/zalohovani/klient`date +%d.%m.%Y`.txt
2.) v tom perl scriptu si ošetřit aby se nastavila jeho pracovní složka na /root/backup a necpat ji do crontabu jako cd **
Je to jen můj názor , možná v tom chyba není ale nejdříve bych vyzkoušel toto.
Oct 6 18:29:01 cron[15793]: (*system*) RELOAD (/etc/crontab)
Oct 6 18:29:01 cron[15793]: Error: bad username; while reading /etc/crontab
Oct 6 18:29:01 cron[15793]: (*system*) ERROR (Syntax error, this crontab file will be ignored)
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
50 * * * * root cd / && run-parts --report /etc/cron.hourly
57 1 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
45 1 * * 5 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
21 3 26 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
20 4 */2 * * /usr/bin/sa-update --no-gpg &> /dev/null
0 0 * * * /usr/local/sbin/quota_notify &> /dev/null
30 4 */2 * * /usr/local/sbin/sa_rules_update.sh &> /dev/null
30 18 * * * /usr/bin/perl /root/backup/backup.pl > /var/log/zalohovani/klient`date +%d.%m.%Y`.txt
58 10 * * * * ... `date +\%.\%m.\%Y`.txt
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.