User Tools

Site Tools


daily_and_weekly_backup_with_rsync

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
daily_and_weekly_backup_with_rsync [2009/10/14 03:22]
jt
— (current)
Line 1: Line 1:
-==== Daily and Weekly Backup with Rsync ==== 
-<code bash | backup-cron.sh>​ 
  
-#!/bin/bash 
- 
-DAY=$(/​bin/​date +%m%d%y) 
-DOW=$(/​bin/​date +%u) 
-PATH="/​media/​backup/​stealthsrv"​ 
- 
-if [ $DOW == '​7'​ ]; then 
- 
-        /​usr/​bin/​rsync -a --delete --inplace --exclude-from '/​root/​exclude'​ /home $PATH/​weekly-$DAY;​ 
-else 
-        /​usr/​bin/​rsync -a --delete --inplace --exclude-from '/​root/​exclude'​ /home $PATH/​daily;​ 
-        /bin/touch $PATH/​daily;​ 
-fi 
- 
-for i in $(/​usr/​bin/​find $PATH -maxdepth 1 -type d -mtime +30); 
-do 
-        echo "​Removing $i: older then 30 days" >> /​var/​log/​backup.log;​ 
-        /bin/rm -Rf $i; 
-done 
-</​code>​ 
daily_and_weekly_backup_with_rsync.1255490538.txt.gz ยท Last modified: 2020/08/10 02:29 (external edit)