Find the answer to your Linux question:
Results 1 to 2 of 2
Hey guys, I am very new to bash scripts and I realize there are ways I could have done a single backup script but the way I started out seemed ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2011
    Posts
    11

    bash script, differential backup


    Hey guys,
    I am very new to bash scripts and I realize there are ways I could have done a single backup script but the way I started out seemed to be easier to me at the time. Basically I have one script that I will run on Sunday which copies a full backup of the directory: /var/www/html/SocProjects
    and places it in directory: /home/erind/socprojects_backups/$b/SocProjects.$a

    a=$(date +%H:%M--%d_%m_%Y)
    b=$(date +%m_%d_%Y)

    Now I want to have another script that I plan to run twice a day that makes a differential copy. Im not sure how to do this. Should I use tar or rsync? Since the pathname to the full backup will change each week (since the date will change) I wasnt sure if this will be a problem when the differential is made. Also I want to do a differential rather than an incremental because size isnt much of an issue and I felt that restoring from a differential would be easier for a newbie like me.

    Thanks for any help,

    Erin

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,384
    May I suggest to use one of the already available and matured backup applications?
    Imho, there is little point in reinventing the wheel, other than for learning purposes.

    rdiff -backup might be fitting.
    More sophisticated backup systems are amanda or bacula.
    But there are many more.
    You must always face the curtain with a bow.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •