Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set -ex
- directory_to_clone=/home/
- cloned_directory=/media/scott/home-backup4tb-1/
- echo SHOW FILES THAT WILL BE OVERWRITTEN
- sudo rsync -rvaPhH --delete --itemize-changes --dry-run $directory_to_clone $cloned_directory
- read -p "Are you sure you wish make these file changes on the clone? " -n 1 -r
- echo # (optional) move to a new line
- if [[ ! $REPLY =~ ^[Yy]$ ]]
- then
- exit 1
- fi
- sudo rsync -rvaPhH --delete $directory_to_clone $cloned_directory
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement