virtualbox, backup, redundant system problem... need advice!

Discussion in 'ISPConfig 3 Priority Support' started by Tomislav Aurednik, Nov 2, 2016.

  1. Tomislav Aurednik

    Tomislav Aurednik Member HowtoForge Supporter

    One question about using rsync. I followed the howto https://www.howtoforge.com/mirroring_with_rsync. I created the user the rsa keys so I don't need the password. My problem is when I want to rsync /var/www I get
    rsync: opendir "/var/www/clients/client2/web1/web" failed: Permission denied (13)
    errors for all my sites.
    The command I'm using is rsync -azq --delete --exclude=**/stats --exclude=**/error --exclude=**/tmp --log-file=/var/log/rsync.log -e "ssh -i /root/rsync/mirror-rsync-key" [email protected]:/var/www/ /var/www/

    Do I need to skip the user creation and create the cert for root and run as root and not syncuser?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    ensure that you run the command as root.
     
  3. Tomislav Aurednik

    Tomislav Aurednik Member HowtoForge Supporter

    yes I'm logged in as root.
    The clients folder has 755 permissions. Does it need 777?
     
    Last edited: Nov 15, 2016
  4. Tomislav Aurednik

    Tomislav Aurednik Member HowtoForge Supporter

    OK... I think the syncuser does not have read permissions for the /var/www/ folder becouse it's root:root as default and the howto only coverd creating the user. So I added syncuser to root with adduser syncuser root. But I still get the same error.
    getent group root
    root:x:0:syncuser
     
  5. Tomislav Aurednik

    Tomislav Aurednik Member HowtoForge Supporter

    #24 didn't work. I edited vi /etc/sudoers and added syncuser ALL=NOPASSWD: /usr/bin/rsync. Now if I use command
    rsync -azq -e "ssh" --rsync-path="sudo rsync" [email protected]:/var/www/ /var/www/ it syncs files but it asks for password.
    trying to combine the rsa key -rsync-path option throws an error. I probbably wrote it wrong
    rsync -azq --rsync-path="sudo rsync" -e "ssh -i /root/rsync/mirror-rsync-key" [email protected]:/var/www/ /var/www/.

    Any idea how to write the command for crontab so it works without password? Do I need to reload the /etc/sudoers for the changes to take affect... if yes how?
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    You have to run the rsync command as root user, not as a sync user. Only root user can read all the files and folders and only root can ensure that the files get the same correct permissions and owners on the target system.
     

Share This Page