Walt Mankowski on 10 Sep 2004 21:04:02 -0000

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Getting only today's logs

I haven't tried it, but looking at the docs for tar it appears that it
doesn't like the YYYYMMDD format.  Try using YYYY-MM-DD instead.


On Fri, Sep 10, 2004 at 04:26:48PM -0400, Aaron Crosman wrote:
> I am trying to write a script that will copy files from our remote
> debian web server to a local SuSE server that processes web logs for
> stats.  For obvious reasons I only want to copy the new files.  Most of
> the script works great.  I can connect the to remote, run the commands
> below, scp the resulting tar.gz file to the local server and decompress
> them in desired directory.  It's the creation of the tar file that seems
> to be giving me trouble.  It always copies all the files, not just the
> new ones.  Can someone please tell me what I'm missing?
> Thanks
> Aaron
> =============== Bash Commands executed on remote host follow
> ====================
> # Get the new date
> now=$(date +%Y%m%d)
> # Get the previous Date
> prev=$(cat date.logs.dump)
> # Remove the old tar file
> rm ~/siteLogs.tar.gz
> # create the new tar file
> tar -czf ~/siteLogs.tar.gz --after-date="$prev"  /www/sitelogs
> # save the date
> echo $now > date.logs.dump
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --        http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug

Attachment: signature.asc
Description: Digital signature