Advertisement
a2n

rsync & git init

a2n
Aug 7th, 2013
1,176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.26 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. WWW_ROOT="/var/www/html"
  4. BACKUP_ROOT="/home/foo/backup"
  5.  
  6. echo "rsync web pages..."
  7. for i in `ls -1d *`; do
  8.   cd $i
  9.   rsync -a . $BACKUP_ROOT/webpages/$i
  10.   git init
  11.   git add -A
  12.   git commit -am "Daily commit."
  13.   cd ..
  14. echo "/rsync web pages..."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement