rsync-time-backup icon indicating copy to clipboard operation
rsync-time-backup copied to clipboard

Applying the retention staregy on a destination where ssh as root is not permitted

Open prontog opened this issue 4 years ago • 5 comments

Hello,

It seems that when you push a backup to a host that you cannot ssh as root the retention strategy fails since you have not enough permissions to remove files. The actuall backup works since rsync--path can be set up as sudo rsync but what about the part before rsync when the strategy is applied?

Regards,

Panos

prontog avatar Mar 19 '20 12:03 prontog

:+1: good catch

reactive-firewall avatar Mar 19 '20 21:03 reactive-firewall

this probable means testing hard-links as part of #190 could be impacted in adition to https://github.com/laurent22/rsync-time-backup/blob/88db869fe7a52864e18afc7e16a971499f79e830/rsync_tmbackup.sh#L249-L251

adding a function like:

fn_test_file_removable() {
 	 fn_run_cmd "test -w '$1'"
 } 

might be of use for this

reactive-firewall avatar Mar 19 '20 21:03 reactive-firewall

The permission problem when logging in as non-root can be solved adding "-M--fake-super" to ssh options.

filippocarletti avatar Mar 21 '20 18:03 filippocarletti

The permission problem when logging in as non-root can be solved adding "-M--fake-super" to ssh options.

🎉 ...Nice! ...um 😕... how? pretend I'm an idiot linux kernel ... just walk me through this with some code

reactive-firewall avatar Mar 22 '20 04:03 reactive-firewall

The permission problem when logging in as non-root can be solved adding "-M--fake-super" to ssh options.

I didn't know about this option. I add rsync to sudoers with NOPASSWD to handle this case. Of course I am not talking about permission issues using rsync but permission issues applying the strategy. The expiration strategy is not using rsync!

prontog avatar Mar 24 '20 23:03 prontog