Advertisement
Guest User

Untitled

a guest
May 2nd, 2022
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #!/bin/bash
  2. set -ex
  3. directory_to_clone=/home/
  4. cloned_directory=/media/scott/home-backup4tb-1/
  5. echo SHOW FILES THAT WILL BE OVERWRITTEN
  6. sudo rsync -rvaPhH --delete --itemize-changes --dry-run $directory_to_clone $cloned_directory
  7. read -p "Are you sure you wish make these file changes on the clone? " -n 1 -r
  8. echo # (optional) move to a new line
  9. if [[ ! $REPLY =~ ^[Yy]$ ]]
  10. then
  11. exit 1
  12. fi
  13. sudo rsync -rvaPhH --delete $directory_to_clone $cloned_directory
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement