SHARE
TWEET

Untitled

a guest Jan 14th, 2020 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. me@mypc:~/temp$ mkdir original backups backups/snapshot1 backups/snapshot2
  2. me@mypc:~/temp$ touch original/FileKeep original/FileRemove original/FileExclude original/FileNewlyExclude
  3. me@mypc:~/temp$ ls */*
  4. original/FileExclude  original/FileKeep  original/FileNewlyExclude  original/FileRemove
  5.  
  6. backups/snapshot1:
  7.  
  8. backups/snapshot2:
  9. me@mypc:~/temp$ rsync -a --delete --delete-excluded --exclude=FileExclude $PWD/original/ $PWD/backups/snapshot1/
  10. me@mypc:~/temp$ ls */*
  11. original/FileExclude  original/FileKeep  original/FileNewlyExclude  original/FileRemove
  12.  
  13. backups/snapshot1:
  14. FileKeep  FileNewlyExclude  FileRemove
  15.  
  16. backups/snapshot2:
  17. me@mypc:~/temp$ rm original/FileRemove
  18. me@mypc:~/temp$ touch original/FileNew
  19. me@mypc:~/temp$ rsync -a --delete --delete-excluded --exclude=FileExclude --exclude=FileNewlyExclude --link-dest=$PWD/backups/snapshot1 $PWD/original/ $PWD/backups/snapshot2/
  20. me@mypc:~/temp$ ls */*
  21. original/FileExclude  original/FileKeep  original/FileNew  original/FileNewlyExclude
  22.  
  23. backups/snapshot1:
  24. FileKeep  FileNewlyExclude  FileRemove
  25.  
  26. backups/snapshot2:
  27. FileKeep  FileNew
  28. me@mypc:~/temp$ find backups/ -name FileNewlyExclude -delete
  29. me@mypc:~/temp$ ls */*
  30. original/FileExclude  original/FileKeep  original/FileNew  original/FileNewlyExclude
  31.  
  32. backups/snapshot1:
  33. FileKeep  FileRemove
  34.  
  35. backups/snapshot2:
  36. FileKeep  FileNew
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top