troubleshooting Question

Backup script using tar/rsync or something

Avatar of syscrash
syscrash asked on
ProgrammingStorage Software
8 Comments1 Solution629 ViewsLast Modified:
I have been attempting to create a backup script heres what I would like to have it do..


Full weekly backup every Sunday.
Incrementals Mon-Fri

Name each backup username-date-.tar.gz(or something similar)

Remove anything older than 7 days

Heres our setup...

We have user home directories stored in /Volumes/Data/homedir all user home directories are seperated via class year IE: 2013, 2012 etc etc.

I have been messing around with scripting for the last couple of days heres what I have so far ( be easy on me I am just learning...)

#! /bin/bash



freshmen="/Volumes/Data/homedir/2013/*"
sophmore="/Volumes/Data/homedir/2012/*"
date=`date +%Y%m%d`
dow=`/bin/date +%a`
dom=`/bin/date +%d`
sophfulltarget="/Volumes/Backups/weekly/2012/"

for u in ${sophmore} ;do
     if [ "${u} in ${sophmore} and ${dow} =Thu" ]
      then
         tar czf $u-${date}.tar $u      
         mv $u-${date}.tar ${sophfulltarget}
     fi
done




ASKER CERTIFIED SOLUTION
gmckeown99

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros