OK - I've been writing smoe backup scripts recently, but have run in to a problem... tar is archiving everything in anything 1 folder or more depth than I specifically request in the script, and not checking it's date.
That's probably not very clear, so I'll try and explain. Firstly, here's my script:
echo "Starting changes backup..."
#The following creates a .tar.gz file, named as so: yymmdd_changes.tar.gz, in the /home/backup directory.
tar -czvf /home/josh/`date +"%y%m%d"`_changes.tar.gz --after-date="`date +%F --date='yesterday'`" /home/josh/backup/addresses/* \
echo "Changes backup complete."
I'm trying to make it only archive files which have been changed since yesterday, to any directory depth, but this tar command will only check the dates of files in a specifically requested directory,
eg, /home/josh/docs/file.txt will be checked and acted on appropriately, but /home/josh/docs/work
/file.txt won't be checked, and will be archived regardless.
any ideas what I'm doing wrong?