From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f8c9b,1c988558d85d56e5 X-Google-Attributes: gidf8c9b,public X-Google-Thread: fee84,1c988558d85d56e5 X-Google-Attributes: gidfee84,public From: Emile van Bergen Subject: Re: crontab: how to put date in archive filename? Date: 1999/09/27 Message-ID: #1/1 X-Deja-AN: 529800856 References: <37EE90F5.C36D7B6A@midwest.net> X-Sender: emile@emile.evbergen.xs4all.nl Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: news.telekabel.nl 938422452 22915 194.134.152.48 (27 Sep 1999 08:54:12 GMT) Organization: TeleKabel Mime-Version: 1.0 NNTP-Posting-Date: 27 Sep 1999 08:54:12 GMT Newsgroups: comp.unix.questions,comp.unix.osf.osf1 On Sun, 26 Sep 1999, Steve Stoddard wrote: > I want to use a crontab command to write daily archives to files having > the dates embedded in the filenames. A FAQ showed me how create such > files at the command prompt, as for example, 'touch home.total.`date > '+%m_%d_%y'`.pax' creates the file 'home.total.09_26_99.pax'. I cannot > get this same command to work in a crontab. The crontab itself is OK, > because 'touch filename' works. What am I doing wrong? I'm running > Tru64 UNIX 4.0E. Thanks! I'm almost certain the problem comes from the fact that 'date' can't be found due to its directory missing from the PATH environment variable when running from cron. (Cron doesn't execute any of /etc/profile or $HOME/.profile before running your command). Specify the full path to 'date' instead and you should be all set. -- M.vr.gr. / Best regards, Emile van Bergen (e-mail address: emile@n293.ede.telekabel.euronet.nl)