2
  1. Does Rsnapshot need root permissions on remote server side? I'm using a common user.

    backup   commonuser@remoteserver:/directory   directory/
    

    I'd like to backup some folders like /home, /opt, /etc and others, but it's not copying all files. My original /home (remote server) has 35GB but rsnapshot only copied 2.6GB.

  2. If I delete a file in my backup folders (e.g. alpha.0), does the file get deleted on remote server side too?

  3. Since rsnapshot works with hardlinks, where are the original files?

EDIT: Now my command gives me this:

rsnapshot -v -c /usr/local/etc/rsnapshot-ovh.conf alpha:

echo 49721 > /var/run/rsnapshot.pid /bin/rm -rf /rsnap_ovh/alpha.5/ mv /rsnap_ovh/alpha.4/ /rsnap_ovh/alpha.5/ mv /rsnap_ovh/alpha.3/ /rsnap_ovh/alpha.4/ mv /rsnap_ovh/alpha.2/ /rsnap_ovh/alpha.3/ mv /rsnap_ovh/alpha.1/ /rsnap_ovh/alpha.2/ /bin/cp -al /rsnap_ovh/alpha.0 /rsnap_ovh/alpha.1 cp: /rsnap_ovh/alpha.0/home/home/zimbra_backup/zimbra/data/ldap/state/run/ldapi is a socket (not copied). cp: /rsnap_ovh/alpha.0/home/home/zimbra_backup/zimbra/data/clamav/clamav.sock is a socket (not copied). cp: /rsnap_ovh/alpha.0/home/home/zimbra_backup/zimbra/data/tmp/amavisd-zmq.sock is a socket (not copied). cp: /rsnap_ovh/alpha.0/home/home/zimbra_backup/zimbra/data/amavisd/amavisd.sock is a socket (not copied). cp: /rsnap_ovh/alpha.0/home/home/zimbra_backup/zimbra/data/sasl2/state/mux is a socket (not copied). cp: /rsnap_ovh/alpha.0/run/run/udev/control is a socket (not copied). cp: /rsnap_ovh/alpha.0/run/run/dbus/system_bus_socket is a socket (not copied). cp: /rsnap_ovh/alpha.0/run/run/abrt/abrt.socket is a socket (not copied). cp: /rsnap_ovh/alpha.0/run/run/proftpd/proftpd.sock is a socket (not copied). cp: /rsnap_ovh/alpha.0/run/run/postgresql/.s.PGSQL.5432 is a socket (not copied). cp: /rsnap_ovh/alpha.0/run/run/systemd/private is a socket (not copied). cp: /rsnap_ovh/alpha.0/run/run/systemd/journal/stdout is a socket (not copied). cp: /rsnap_ovh/alpha.0/run/run/systemd/journal/socket is a socket (not copied). cp: /rsnap_ovh/alpha.0/run/run/systemd/notify is a socket (not copied). cp: /rsnap_ovh/alpha.0/run/run/systemd/cgroups-agent is a socket (not copied). cp: /rsnap_ovh/alpha.0/run/run/systemd/shutdownd is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/trace is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/proxymap is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/defer is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/tlsmgr is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/rewrite is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/scache is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/tlsproxy is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/cyrus is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/anvil is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/discard is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/lmtp is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/uucp is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/maildrop is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/smtpd is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/old-cyrus is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/smtp is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/local is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/relay is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/dnsblog is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/bounce is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/virtual is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/scan is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/ifmail is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/retry is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/bsmtp is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/smtp-amavis is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/verify is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/private/error is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/public/pickup is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/public/cleanup is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/public/qmgr is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/public/flush is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/postfix/spool/public/showq is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/tmp/mysql/mysql.sock is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/tmp/amavisd-zmq.sock is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/sasl2/state/mux is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/clamav/clamav.sock is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/ldap/state/run/ldapi is a socket (not copied). cp: /rsnap_ovh/alpha.0/backups/backups/zimbra_backup/data/amavisd/amavisd.sock is a socket (not copied). /usr/local/bin/rsync -ptog --delete --numeric-ids --relative \ --delete-excluded --rsh=/usr/bin/ssh root@remoteserver:/backups \ /rsnap_ovh/alpha.0/backups/ ---------------------------------------------------------------------------- rsnapshot encountered an error! The program was invoked with these options: /usr/local/bin/rsnapshot -v -c /usr/local/etc/rsnapshot-ovh.conf alpha ---------------------------------------------------------------------------- ERROR: /usr/local/bin/rsync returned 1 while processing root@remoteserver:/backups touch /rsnap_ovh/alpha.0/ rm -f /var/run/rsnapshot.pid

  • Your example shows backing up of /directory. If you want to backup /home, /opt, and /etc please show the actual lines. While you're editing your question please include the definition for rsync_short_args and rsync_long_args. – roaima Jul 7 '18 at 10:49
  • 1
    My rsync_short_args and rsync_long_args are commented. I added my rsnapshot -t output. – Mateus Scheper Jul 9 '18 at 21:45
2

You normally want to run rsnapshot as root user and also copy the files as root on the remote side. Otherwise all user and group ownerships would be set to the user you are using to connect to the remote side, which will render your backup to useless.
To check why not all data was copied, look into the logs which by default is the system log or if you have configured a logfile you have to consult that one. In doubt which log mechanism is enabled, check your configuration file.
If you run the cronjob as common user, that might be the cause as the user might not have the permission to copy all the data.

You shouldn't touch the backup folders rsnapshot is creating. rsnapshot will copy things from the source as it is and will create a new folder which will reflect the contents of the source at a given time. Depending on your retention policy, a deleted folder in the source will vanish over time in your backup.

Hardlinks are different directory entries pointing to the same inode. It is not possible to determine which directory entry was the original. It is also possible that the first directory entry pointing to a file was deleted a long time ago, but other directory entries are still pointing/referencing this file.

  • Hi! Thank you for your reply. I noticed this in my log: Jul 9 09:04:09 rsnapshot rsnapshot[9615]: /usr/local/bin/rsnapshot -c /usr/local/etc/rsnapshot-ovh.conf alpha: ERROR: /usr/local/bin/rsnapshot -c /usr/local/etc/rsnapshot-ovh.conf alpha: completed, but with some errors I'm running rsnapshot as root and connecting to root@remoteserver, but it's still giving me incomplete backups. root@rsnapshot:/var/log # du -lhs /rsnap_ovh/alpha.0/backups/backups 56G /rsnap_ovh/alpha.0/backups/backups Remote server: du -lhs /backups 82G /backups – Mateus Scheper Jul 9 '18 at 21:37
  • Try to run rsnapshot with -v flag and/or increase the verbosity within your config file. – Thomas Jul 10 '18 at 6:41
  • It says some files are sockets and it won't copy them. I edited my question. – Mateus Scheper Jul 11 '18 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.