[lug] cron and date command

Gordon Golding gordongoldin at netscape.net
Wed Mar 8 12:36:52 MST 2006


I want to run a backup script and feed it today's date.  I know I can change the script and be OK, but I'm wondering about this problem.
I'm on Fedora Core 3.

If I use `date +%y%m%d` it works fine from the command line.  But I run the same command in cron and it doesn't run - it doesn't create the log or err files or run the script.

Neither of these 2 entries work. This example runs it hourly for testing. In the second example it doesn't work either as a parameter or part of the file name.

0  *    *   *   *  BACKUPNAME=name`date +%y%m%d`
0  *    *   *   *  /home/BACKUPS/Backup_to_Disk2.bsh name`date +%y%m%d` 1>/home/BACKUPS/name`date +%y%m%d`.log 2>/home/BACKUPS/name`date +%y%m%d`.err




Gordon Golding
aka Golding the Younger DH70
gordongoldin at netscape.net
http://cslr.colorado.edu/beginweb/cgi-bin/gen_page.php?user=goldingg&&group=STF
303-494-5730
"If Love is Blind, why is lingerie so popular?"


__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp



More information about the LUG mailing list