Solved: lsyncd failed to sync files

I want to backup my data to another server with lsyncd, when I do this, I encounter two problems, here is the solution that I solve the problem.

Install rsync on the remote server

This is the first problem that I encounter, I setup a remote server, and configure the lsyncd configure file, but after I start the lsyncd service, the file didn’t sync to the remote server.

I try to sync file with rsync from remote server, and find that the rsync does not installed on the remote server, and I also notice that I configured the lsyncd to sync file with rsync. After I install the rsync on the remote server, the files synced to the remote server successfully.

The remote directory permission

Another problem that I encounter is that I sync from another server to the same server, and when I use nload to monitor the network, and I find that the file was send to the remote server, but I can’t see any files on the remote server.

I thought that was because I sync files from two different serves to the the same remote server, and that has problem, so I want to start sync files after the first sync job finished.

Today, I start the sync job from the second server again, and find that the problem was still there. I want to look into the lsync log file, but there are no any error logs on the log file.

Finally I remember that when I use systemctl status -l lsyncd, this will show the sync status, and I find the problem with the command, and I find some error message like Permission denied, and when I investigate the remote server, I find the destination folder was created with root user, but the sync job was not by root user. after I changed the owner of the destination folder, the sync job running successfully.

Leave a Reply

Your email address will not be published. Required fields are marked *