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: Steve Stoddard Subject: Re: crontab: how to put date in archive filename? Date: 1999/09/28 Message-ID: <37F10CC3.3E90F417@midwest.net>#1/1 X-Deja-AN: 530496220 Content-Transfer-Encoding: 7bit References: <37EE90F5.C36D7B6A@midwest.net> Organization: Posted via Supernews, http://www.supernews.com Content-Type: text/plain; charset=us-ascii MIME-Version: 1.0 Newsgroups: comp.unix.questions,comp.unix.osf.osf1 X-Complaints-To: newsabuse@supernews.com Found the answer. Both replies were partially correct but there was an additional problem: the backticks were OK but the inside single quotes in the command string, while OK in a terminal, were messing it up in the crontab even after adding the backslashes. The correct crontab command for tcsh and bash is: touch home.total.`/usr/bin/date +\%m_\%d_\%y`.pax S. Stoddard 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! > > Steve Stoddard