Rsnapshot WARNING: Could not lchown() symlink “/path/to/file” Error and Solution

The rsnapshot warning message “Could not lchown() symlink” indicates that the rsnapshot backup utility encountered a problem while trying to set the ownership of a symbolic link during the backup process. The lchown() function is used to change the owner of a file, and it can’t be used with symbolic links.

Here’s how you can address this issue:

  1. Open a terminal window.
  2. To avoid the rsnapshot utility trying to set the ownership of a symbolic link during the backup process, you can add the noatime option to the rsync_long_args configuration parameter in the rsnapshot.conf file. Here’s how to do it:
sudo nano /etc/rsnapshot.conf

This will open the rsnapshot.conf file in the nano text editor.

  1. Locate the rsync_long_args parameter and add the --noatime option to the end of the line, like this:
rsync_long_args --delete --numeric-ids --relative --delete-excluded --stats --noatime

This will prevent rsnapshot from trying to set the ownership of symbolic links during the backup process.

  1. Save the changes and exit the text editor.
  2. Restart the rsnapshot service to apply the changes:
sudo systemctl restart rsnapshot

This should resolve the “Could not lchown() symlink” warning message.

(kathybroock.com)

Leave a Comment