Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup over SSH confuses 'ssh' and 'local' commands? #57

Open
joshbrooks opened this issue Mar 25, 2024 · 0 comments
Open

Backup over SSH confuses 'ssh' and 'local' commands? #57

joshbrooks opened this issue Mar 25, 2024 · 0 comments

Comments

@joshbrooks
Copy link
Contributor

Not sure how to summarize this except that it seems that there's some unintended behaviour when backing up over ssh where the src and dest parameters are mixed up.

This leads to the check for backup.marker running over the SSH connection on the source, and the latest link being created on the source.

Description

  • rsync-time-machine requires a backup marker on the source not dest when backing up over ssh
  • The destination directory is created on the SSH source
  • The 'latest' link is created on the SSH source

Details

I'm backing up a folder over ssh with the command

rsync-time-machine [email protected]:/home/josh/Documents /tmp/edesk.local/Documents

So edesk.local is my source, and I'm backing up to to machine the script is running on. I expect this to mirror the content of my remote folder (@edesk.local) to /tmp/... on the computer I run the command on.

Here is what happens the first time

/tmp via 🐍 v3.11.3 (rdiffdb-py3.11) 
❯ rsync-time-machine [email protected]:/home/josh/Documents /tmp/edesk.local/Documents
rsync-time-machine.py: Safety check failed - the destination does not appear to be a backup folder or drive (marker file not found).
rsync-time-machine.py: If it is indeed a backup folder, you may add the marker file by running the following command:
rsync-time-machine.py: ssh -p 22 [email protected] 'mkdir -p -- "/tmp/edesk.local/Documents" ; touch "/tmp/edesk.local/Documents/backup.marker"'

As expected there is no backup marker, so it errors out.
However what's surprising here is that the command given is to add the backup marker, on the source (that is, edesk).

OK, we run that command suggested

❯ ssh -p 22 [email protected] 'mkdir -p -- "/tmp/edesk.local/Documents" ; touch "/tmp/edesk.local/Documents/backup.marker"'

and now we run backup the command again with the following result.

❯ rsync-time-machine [email protected]:/home/josh/Documents /tmp/edesk.local/Documents                                     
rsync-time-machine.py: No previous backup - creating new one.
rsync-time-machine.py: Creating destination ssh -p 22 [email protected]/tmp/edesk.local/Documents/2024-03-25-162106
rsync-time-machine.py: Starting backup...
rsync-time-machine.py: From: [email protected]:/home/josh/Documents/
rsync-time-machine.py: To:   /tmp/edesk.local/Documents/2024-03-25-162106/
rsync-time-machine.py: Running command:
rsync-time-machine.py: rsync -e 'ssh -p 22 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' -D --numeric-ids --links --hard-links --one-file-system --itemize-changes --times --recursive --perms --owner --group --stats --human-readable --compress --log-file '/home/josh/.rsync-time-backup/2024-03-25-162106.log'  -- '[email protected]:/home/josh/Documents/' '/tmp/edesk.local/Documents/2024-03-25-162106/'
rsync-time-machine.py: [ERROR] Rsync reported an error. Run this command for more details: grep -E 'rsync:|rsync error:' '/home/josh/.rsync-time-backup/2024-03-25-162106.log'

Now I have a backup directory created; but it's on edesk (the ssh source)!

I create the backup directory on destination

mkdir -p /tmp/edesk.local/Documents/

and now it completes without errors, I can run
rsync-time-machine [email protected]:/home/josh/Documents /tmp/edesk.local/Documents and everything backs up.

However

  • There is no check for a backup.marker in this folder
  • The 'destination' folders are actually created on edesk
  • The latest folder is not created here but on edesk
@joshbrooks joshbrooks changed the title Backup over SSH Backup over SSH confuses 'ssh' and 'local' commands? Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant