Seafile and rsync with root not working but user seafile is ok?

I’ve been doing a lot of Seafile testing especially with disaster recovery. It is crucial that I can restore the entire seafile database from one drive to another if needed. I use rsnapshot, basically rsync, to backup one drive to another but I’ve noticed that restore the seafile database fails and requires seaf-fsck to be run after. After further investigating it appears the rsync fails to copy some files. It is because rsync is launched as “root” user insatead of user “seafile”. If I do it manually with the seafile user everything works. Now root is the all-mighty account, why would it fail?

Root user should be able to copy any files on the system. So I guess your procedure may fail due to some other reason. For example, have you stopped seafile server during the backup? If not, some newly added files may be missing in the backup drive.