backup_sudoers 1.1 KB

1234567891011121314151617
  1. Cmnd_Alias MOUNT = /bin/mount /dev/mapper/crypt-YOUR_UUID_HERE /mnt/YOUR_UUID_HERE, /bin/umount /mnt/YOUR_UUID_HERE
  2. Cmnd_Alias LUKS = /sbin/cryptsetup luksOpen --key-file\=- /dev/disk/by-uuid/YOUR_UUID_HERE crypt-YOUR_UUID_HERE, /sbin/cryptsetup luksClose crypt-YOUR_UUID_HERE
  3. Cmnd_Alias DIR = /bin/rmdir /mnt/YOUR_UUID_HERE, /bin/mkdir /mnt/YOUR_UUID_HERE
  4. Cmnd_Alias RSYNC = /usr/bin/rsync
  5. Cmnd_Alias RSNAPSHOT = /usr/bin/rsnapshot hourly, /usr/bin/rsnapshot daily, /usr/bin/rsnapshot weekly, /usr/bin/rsnapshot monthly, /usr/bin/rsnapshot yearly
  6. Cmnd_Alias CRYPTSHOTR = /usr/local/sbin/cryptshotr -q hourly, /usr/local/sbin/cryptshotr -q daily, /usr/local/sbin/cryptshotr -q weekly, /usr/local/sbin/cryptshotr -q monthly, /usr/local/sbin/cryptshotr -q yearly
  7. ## On laptop, when remote is accessing
  8. ## Laptop needs RSYNC and CRYPTSHOTR, as 'sudo cryptshotr' will handle the decrypting/mounting/mkdir. laptop backup user needs RSYNC. 'cryptshotr-cron' needs CRYPTSHOTR.
  9. ## Remote server needs MOUNT, LUKS, DIR, RSYNC, and RSNAPSHOT.
  10. %backups ALL=(ALL) NOPASSWD: RSYNC, CRYPTSHOTR