LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Backup script using bash, find & zip

[ILUG] Backup script using bash, find & zip

Justin MacCarthy macarthy at iol.ie
Mon Mar 25 14:28:02 GMT 2002


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





More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell