How to backup /home properly (fifo/socket)?

Hi,

after using rsync -a to copy my home folder to another disk, I used diff -rq --no-dereference to check if everything is intact, but I got weird results from diff:

file … is a socket while file … is a socket
file … is a fifo while file … is a fifo

So if I restore this stuff, I guess it would confuse manjaro and break stuff?
Would that non-file stuff (whatever fifos/sockets are) not be there if I did the backup while the system is shutdown, booting another OS from a flash drive ?
Can’t I safely backup /home of a running system?
Do I have to redo the backup or can I somehow remove fifos/sockets and it would be safe?

That’s a very rudimentary way of using rsync, and definitely not a correct one. You should read the man page.

A more appropriate use of rsync would have dealt with that, but what I find curious is that you’ve got named pipes and sockets under /home in the first place.

Hint: If you don’t know what those are, then look up on them.

With a proper tool, yes. There are many easy-to-use tools for creating backups in the repositories.

Like I said, I have no idea how come you’ve got those under /home in the first place, because that’s not the right place for them.

2 Likes

Why is it incorrect? I guess saving file ownership is unnecessary, but I read that I will have probably have to use chown on the new system anyways.

Thats like reading the manual for a jet when all you want is to fold a paper plane. What do I need to look at?

I did, but from what I read, an empty “file” not comparing to another empty file especially if it has not been in use still does not make sense to me.

The socket files are from ~/.config/opera/oauc_pipe and ~/.steam/steam.pipe

  • Did you follow symlinks ?
  • Did you (ever) create symlinks in /home or under ?
  • Why don’t you share the path of these sockets/fifos, so one could answer ?

So you did copy with rsync while opera and steam where running :rofl:
You will not need them :100:

rsync has a lot of options ! One of them disables the copy of special files.

I allways backup file ownership and permissions. Some programs will refuse to work when permissions are wrong.

2 Likes

No it’s like reading the manual for the tool you’re trying to use.

1 Like

They were definitely not running.

It’s not just file ownership, but also permissions, special files, and whether or not to follow symbolic links or copy them as a symlink only.

All of the different options.

You’re not folding a paper plane; you’re in a jet and you’re taking it for a spin around the airfield. Either read the manual or use a tool that doesn’t require it.

Named pipes and sockets are special file types. Calling them “empty files” would be like referring to a terminally ill patient as “a bit under the weather”. :roll_eyes:

--archive, -a            archive mode is -rlptgoD (no -A,-X,-U,-N,-H)

--recursive, -r          recurse into directories
--links, -l              copy symlinks as symlinks
--perms, -p              preserve permissions
--times, -t              preserve modification times
--group, -g              preserve group
--owner, -o              preserve owner (super-user only)

-D                       same as --devices --specials

--devices                preserve device files (super-user only)
--specials               preserve special files

I think rsync -a as root is very much o.k. - the integrity checking using diff afterwards not so much.

Ok, so what tool would you recommend?

@Nachlese
For special files, the rsync manpage is only giving sockets and fifos as examples, but sounds like there are more. I guess special files are not important to backup, but how do I know for sure?

So what would you recommend for checking if everything was copied safely - just run rsync again and see if it complains? I ran rsync with --info=progress2 and it finished at 99%, so I wanted to be sure.

I think you should not guess and rather back up everything.
device files are another file type that is “special”

You can’t compare them with diff - wrong tool for the job, hence the errors.

I would not call that “finished” then.
It should have told you what it choked on.

I’m not an rsync expert - have only ever used it just like you did.
When it finished without error I didn’t question and triple check the result.

There are many more options to rsync - read what they do.
man rsync

It’s also easy to find many examples online …

1 Like

deja-dup. It’s in the repo.

1 Like

I use backintime that does the job very well. I restored several times without any issues. It uses rsync and copies only files that has changed since last backup. I run it every night and backup / to a USB-drive.

I also tried to just read the manual of rsync … tooo complicated for me and why should i understand this endless command line options and their dependencies on each other?

Take for example backintime and feel save :slight_smile: