Unix scripting - Date cmd - if ne to today then move?
Posted on 2009-05-13
I'm asking for help in writing a script to move some log files. I'm stuck on the date cmd. I want to move any file that ends in .log and whose date is not equal to today. The o/s is Redhat's linux. I've read the man page on the date cmd, and I'm searching for examples on how this is done, but I haven't found it yet. Would somebody help me out with a bit of code? Here's what I've got and this works for me, what I need help with is to figure out how to select the files whose date is not equal to today's date. Thanks
mv 2009-05-10*.log /var/httplogs/
tar -cvf 2009-05-10.tar /var/httplogs/
ftp -i -n $FTPSERVER << EOF
user $USER $PASS