Rupert Heesom on Wed, 18 Apr 2001 16:20:16 -0400 |
On 18 Apr 2001 14:42:15 -0400, Rupert Heesom wrote: > I'm trying to create a crontab entry which would create a file with the > current day's date as the file name. To test the cron entry, I put > together the following cron line. The error I get mailed to me, are the > 2 lines below. Evidently cron doesn't like the "%" I have in the > command. Is this normal? > > If so, would I be able to run the same command using a shell script run > as a cron job? > > Crontab line: > */2 * * * * touch $(date +%a-%e-%m) I've now tried to put the command in a shell script, and run the script as a cron job, less luck - I don't get any error msgs this time. Cron line - */2 * * * * /home/rupert/Scripts/Date_cronjob (I have several lines above this one in the crontab, all starting with "#" to comment them out) Script file permissions - -rwxrw-r-- 1 rupert rupert 52 Apr 18 14:52 Date_cronjob Script file contents - #!/bin/sh cd /home/rupert touch $(date +%a-%e-%m) --------------------------------------------- This has been a long standing issue for me; not being able to put together working cron jobs. Can anyone show me where I'm going wrong?? If I run the script manually, it does what I want to do OK, but the cron daemon doesn't seem to touch it! -- regs rupert ______________________________________________________________________ Philadelphia Linux Users Group - http://www.phillylinux.org Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce General Discussion - http://lists.phillylinux.org/mail/listinfo/plug
|
|