I have a very simple bash script that everyday backs up any files modified
yesterday to a zip file. as follows
#!/bin/bash
FILENAME=`date --date=yesterday +%d_%m_%Y.ZIP`
find /d/data -daystart -mtime 1 | zip /d/backups/$FILENAME -@
However there is already is data in the /d/data directory, so I want to
modify the script to create zips for all the file that where there BEFORE I
started using this script
logic is
#get earliest mdate in the directory is [startdate]
#first zip file date is (I can hard code this in) [firstzipdate]
#Loop from startdate to firstzipdate and create a zip for that date
#(if there are any files ) zipfilename format = dd_mm_yyyy.zip
Can anyone point me in the right direction?
Thanks
Justin
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!