Thanks Jack and Michael for the pointers! Sorry to take so long to get back. I've used the --exclude option as Michael suggested for now. Also thanks for pointing out the -z option for tar; believe it or not I thought I was actually using that already, I guess my biggest problem is not paying attention :)
I'm also going to take a look at cdbkup. I'm not so much trying to reinvent the wheel really, as I am trying to get more familiar with scripting. As I already mentioned, I really glazed over two really obvious options that were available to me (doh!) I also like the simplicity of being able to use stuff that's already on my system. Thanks again! Mike > why reinvent the wheel? Go to freshmeat.net and type cd backup into the > search. cdbkup is the one I picked, it seems to work. I only use it for > my MP3 repository though, everything else is just rsynced to multiple > systems. > > On Sun, 2003-06-08 at 21:51, Michael Holt wrote: >> Hey, >> I'm looking for some help on my little backup script for my server. I'm >> not a real savvy scripter so please bare with me :) >> I googled around awhile back and put together a bu script that has >> served >> my purpose well until now. It's just a few lines as you will see and I >> use it with cron to make a cdrw every morning at 3am. >> >> Now the info on my server is starting to outgrow just on cdrw (jpgs and >> such) so I would like to know how I can modify my script to be able to >> exclude either certain files or directories. I imagine that sed would >> be >> involved, but I don't completely understand that tool so I'm hoping that >> someone might be able to give me some pointers and maybe even explain >> how >> the code will work in that setting. Well, here's what I've got now: >> >> >> #!/bin/bash >> # >> # create daily backup of essential files >> # >> DATA="/var" >> CONFIG="/etc" >> # >> set $(date) >> # >> # daily full backup: >> # >> tar -cvf "/mnt/backup/data/df$2$3.tgz" $DATA >> # >> tar -cvf "/mnt/backup/config/cf$2$3.tgz" $CONFIG >> # >> # make iso image and burn it to disk: >> mkisofs -o /tmp/backup.iso /mnt/backup/* >> # >> cdrecord -v blank=fast dev=0,2,0 speed=2 -eject /tmp/backup.iso >> rm -f /tmp/backup.iso >> rm -f /mnt/backup/data/* >> rm -f /mnt/backup/config/* >> >> >> In this setting, I can just add all the directories that I want to back >> up, but it would be much simpler to add just the parent directories and >> then exclude *.jpg for example or maybe a whole child directory. >> >> Thanks a bunch for any help! Mike
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com