Could somebody assist me in creating a working udev rules (Debian 11) for the following actions, please:
- A USB disk (2 TB or bigger) has a given volume id of e.g. „abc“.
- When the USB disk is attached to one of the USB ports of the Debian 11 host, the udev rule should be applied (i.e. telling the operating system that a USB device is „available“ for later-on mount (see note 2 below).
- The intention is to backup data residing in Windows 10 network shares (provided by Samba on a Debian server) to USB disk, either by rsync or rdiff-backup.
- There will be a bash script which will be launched as a nightly cron job performing the backup. The script is going to mount the USB disk.
- After the backup is completed, the USB disk will be unmounted and re-mounted the other night by the cron job.
- There should be NO user interaction (except manually detaching the physical USB disk and attaching another USB disk to the server.
- The backup script has provisions for a protocol about success and/or errors.
- Which tool do you recommend for backup: rsync or rdiff-backup?
- Which filesystem do you recommend for the USB disk? Ideally it should be possible to easily restore files and directories via windows workstations back to the network shares, but this is NOT mandatory. Restoring can also be accomplished on Linux.
- Do you recommend „ionice“ for the backup procedure? Which options?