Guest User

Ivan - ZFS Backups

a guest
Nov 23rd, 2016
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. Hello Allan and Kris,
  2.  
  3. I've been working on a little script to help me with site backups. Since site
  4. files don't change often I though of using ZFS and its snapshot feature as
  5. destination combination for site backups.
  6.  
  7. What I planned to do is to backup files to that remote ZFS location and then
  8. create ZFS snapshot with:
  9.  
  10. zfs snapshot backup@`date +%Y%m%d%H%M`
  11.  
  12. Every time new data backs up it should overwrite the existing data and new
  13. snapshot will be created. That should (at least in theory) save huge amounts of
  14. space (vs backing up same data over and over, since snapshots are just deltas,
  15. right?) but I am not exactly sure on how should I approach file restores so I
  16. could really use advice from Mr. ZFS (Allan).
  17.  
  18. Issuing:
  19.  
  20. zfs rollback backup@SOMEOLDERDATE
  21.  
  22. would result in followiing error:
  23.  
  24. cannot rollback to 'backup@SOMEOLDERDATE': more recent snapshots or bookmarks
  25. exist
  26. use '-r' to force deletion of the following snapshots and bookmarks:
  27. ---LIST-OF-SNAPSHOTS---
  28.  
  29. Instead I should probably use zfs send and pipe it to a new location? Example:
  30.  
  31. zfs send backup@SOMEOLDERDATE > /backup/SOMEOLDERDATE
  32.  
  33. or is there a better way? How would you approach this issue?
  34.  
  35. Thank you in advance.
  36.  
  37. P.S. Snapshoting at the source server and then issuing zfs send would be the
  38. best solution, and I may do that in the future but it isn't really relevant for
  39. this "issue".
  40.  
  41. Kind regards,
  42.  
  43. --
  44. Ivan
Add Comment
Please, Sign In to add comment