Created
          April 2, 2014 17:19 
        
      - 
      
- 
        Save bcalloway/9938720 to your computer and use it in GitHub Desktop. 
    Full system backup that runs once a week
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/sh | |
| ###################################################### | |
| # This script executes a full system backup. | |
| # | |
| # A cron job should run this weekly. | |
| # 0 3 * * 0 sh /home/bcalloway/scripts/system_backup.sh > /dev/null | |
| # | |
| # 2014-04-01 Brandon Calloway | |
| ###################################################### | |
| # initial GoogleDrive sync | |
| grive | |
| DATE=`date +%Y-%m-%d%n` | |
| #first remove the old timestamp file | |
| /bin/rm -f /var/log/usr.snar | |
| #remove the old backups | |
| /bin/rm -f /mnt/GoogleDrive/backups/* | |
| #create the new full backup | |
| /bin/tar -cvpzf /mnt/GoogleDrive/backups/$DATE.full.tar.gz --exclude=/mnt/GoogleDrive --exclude=/home/bcalloway/_backup --listed-incremental=/var/log/usr.snar --one-file-system / | |
| # final GoogleDrive sync | |
| grive | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment