putting date into file name

Steve Anderson andersons001 at hawaii.rr.com
Thu Feb 28 21:30:31 PST 2002


Here is an example of a script creating a file name with the DATE in the
file name:

#!/bin/sh
DATED=`date '+%d%b%H%M'`
cd /usr/local/apache/logs
tar cfp /tmp/$DATED.apache_log.tar access_log
/opt/local/bin/gzip /tmp/$DATED.apache_log.tar  > /dev/null
ftp -inv 192.168.1.22 << EOF > /dev/null
user anonymous guest at here.com
prompt off
ascii
cd /pub/log
lcd /tmp
put $DATED.apache_log.tar.gz
quit
EOF
rm /tmp/$DATED.apache_log.tar.gz



More information about the LUAU mailing list