1833781 Members
2508 Online
110063 Solutions
New Discussion

About crontab

 
Kevin.Wang
Frequent Advisor

About crontab

# crontab -e
50 13 * * 5 fbackup -f /backup/app.`date '+%y%m%d'` -0i /tmp/demo -I index.tmp

but after 13:50,i find that fbackup hasn't been run. why?
8 REPLIES 8
Fragon
Trusted Contributor

Re: About crontab

Hi,please check:
1. Whether the system date is today, you mean only Friday do the backup;
2. Manually run the "fbackup -f ...",what's the result?
3. Check /var/mail/root for errorlog!

good luck!

-ux
twang
Honored Contributor

Re: About crontab

please check the /var/adm/cron/log, does it record your previous cronjob.
twang
Honored Contributor

Re: About crontab

please check the /var/adm/cron/log, does it record your previous cronjob.
twang
Honored Contributor

Re: About crontab

please check the /var/adm/cron/log, does it record your previous cronjob?
twang
Honored Contributor

Re: About crontab

1. create script (backup_cmd.sh)like this:
fbackup -f /backup/app.`date '+%y%m%d'` -0i /tmp/demo -I
2. edit crontab as follows:
50 13 * * 5 backup_cmd.sh

Sorry for the connection problem above.
Michael Tully
Honored Contributor

Re: About crontab

never run a script or program from cron that does contain the full path. i.e. /usr/sbin/fbackup

You may get an indication from root's mail. The other thing to be sure of is that the program or script has executable permissions. In the command your using, it will be a path problem.
Anyone for a Mutiny ?
Kevin.Wang
Frequent Advisor

Re: About crontab

It's ok now.

# more /backuporadata/backu01
fbackup -f /backuporadata/oracle.app.`date '+20%y%m%d'` -0i /u01
# crontab -l
59 23 * * 5 /backuporadata/backu01
Michael Kelly_5
Valued Contributor

Re: About crontab

Kevin,
you need to escape the % characters in your crontab command. See crontab(1) for details of why this is necessary.

The correct version of the command is:

50 13 * * 5 fbackup -f /backup/app.`date '+\%y\%m\%d'` -0i /tmp/demo -I index.tmp

HTH,
Michael.
The nice thing about computers is that they do exactly what you tell them. The problem with computers is that they do EXACTLY what you tell them.