LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Mysterious rsync error (https://www.linuxquestions.org/questions/linux-software-2/mysterious-rsync-error-4175614400/)

kekie 09-23-2017 10:19 PM

[SOLVED] Mysterious rsync error
 
I'm trying to create a mirror of my home dir to a remote machine over ssh using rsync. I'm getting these errors:

Code:

rsync: Failed to exec lete: No such file or directory (2)
rsync error: error in IPC code (code 14) at pipe.c(85) [sender=3.1.1]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in IPC code (code 14) at io.c(226) [sender=3.1.1]

Code:

dmesg | tail
just gives me some stuff about my keyboard being plugged in. I can post logs if they would be useful.
Both machines are ubuntu linux, and I'm using ssh keys.
I'm using the -c and -delete options w/ rsync.

Anyone know what's with this error? Failing that, anyone have any advice for creating this kind of backup? I'm using rsync since it's got that delta transfer algorithm, which sounds perfect for my slow connection.

timl 09-23-2017 11:13 PM

Could you let us know the actual rsync command pls?

Cheers

kekie 09-23-2017 11:17 PM

It was rsync -c -delete /home/kekie/ kekie@remote:/path/to/backup/dir

timl 09-23-2017 11:32 PM

Got it
Quote:

[tim@eraserhead ~]$ rsync -c -delete /home/tim/ tim@192.193.294.195:/home/tim/xyz
rsync: Failed to exec lete: No such file or directory (2)
rsync error: error in IPC code (code 14) at pipe.c(85) [sender=3.1.2]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in IPC code (code 14) at io.c(226) [sender=3.1.2]
Quote:

[tim@eraserhead ~]$ rsync -c --delete /home/tim/ tim@192.193.294.195:/home/tim/xyz
rsync: --delete does not work without --recursive (-r) or --dirs (-d).
rsync error: syntax or usage error (code 1) at main.c(1567) [client=3.1.2]
Quote:

[tim@eraserhead ~]$ rsync -c --delete -r /home/tim/ tim@192.193.294.195:/home/tim/xyz
You need 2 dashes before delete:

Quote:

--delete
To get over the recursive error use -r

kekie 09-23-2017 11:46 PM

Good stuff! What an odd error, I would have expected an 'invalid option -delete'
I'm making progress, now I'm getting a "permission denied (publickey)" I'm trying to figure out how to specify an identity file to rsync like you do with ssh...

kekie 09-23-2017 11:53 PM

There we go, adding this option fixed they key error:
Code:

-e "ssh -i /path/to/private/key"
It's all working now. I'm just an amateur, maybe some wizard here can tell me if running this command periodically is a good way to back up my home directory. Are there better ways?

timl 09-24-2017 02:37 AM

In my opinion you are on the right track. I use this method to back up a number of PCs to my server (which is in turn backed up). If you lose a disk or when you upgrade you have a perfect snapshot of where you were. Maybe other people could contribute but I have a few custom tools set up so I also back up.

Quote:

usr/local/sbin
/usr/share/applications
as well as fstab. Nice to be able to just pick up where I left off when trouble comes calling

Beryllos 09-25-2017 01:24 AM

Quote:

Originally Posted by kekie (Post 5762198)
... It's all working now. I'm just an amateur, maybe some wizard here can tell me if running this command periodically is a good way to back up my home directory. Are there better ways?

Looks good so far. A reasonable next step might be to keep incremental backups. That way, you can recover modified or deleted files from prior backups. To do this with rsync, create a new backup directory on the destination and use the --link-dest option to link it to the old backup directory. To save disk space, the destination file system must be a type that supports hard links (for this I have used ext3 or ext4). If the destination file system doesn't support hard links, rsync with --link-dest will simply save another full backup, same as if you hadn't used --link-dest.

Example: if you created an initial backup by this command:
Code:

rsync -cr --delete /home/kekie/ kekie@remote:/path/to/first/backup/
then you could create an incremental backup by the following command:
Code:

rsync -cr --link-dest=/path/to/first/backup /home/kekie/ kekie@remote:/path/to/second/backup/
The --delete option is irrelevant when you create a new backup directory (nothing there to delete).

Long ago, I developed a bash script based on this idea. It worked fine, and it was educational and fun to write it. I would be glad to advise you on that. However, if you just want to get the backup done, there are backup packages that use rsync behind a nice GUI. Search the web for "backup for linux" if you are interested in that.

rknichols 09-25-2017 08:05 AM

Quote:

Originally Posted by kekie (Post 5762197)
Good stuff! What an odd error, I would have expected an 'invalid option -delete'

It parses as "-d -e lete". That's a flag "-d" that takes no argument followed by a flag "-e" that takes the rest of the string as its argument.

kekie 09-25-2017 11:47 AM

@rknichols: I see, that makes more sense, thanks!
@Beryllos: I was originally planning on just copying the mirror folder and mirroring to the copy to make incremental backups, but that would waste disk space, as you mentioned. I didn't know rsync had this functionality, thanks!


All times are GMT -5. The time now is 02:18 PM.