Recursive backup

Discussion in 'Installation/Configuration' started by erk, May 29, 2006.

  1. erk

    erk New Member HowtoForge Supporter

    Hi all!

    Just thought I might share a feature that I ran across. Might be something htat should be fixed in next release.
    One of my users added a symlink to his website to make point back to This was done with a symlink, i.e. /home/www/webXX/web/funnypath -> /home/www/webXX/web/.
    This causes the backup script to recurse and create a huge backup file filling the quota for the user.

    In the backup script /root/ispconfig/scripts/shell/backup.php I changed
    exec("cd $web_pfad; $zip -r $tmp_dir/web".$web_id." *");
    exec("cd $web_pfad; $zip -ry $tmp_dir/web".$web_id." *");

    That is -ry and not only -r as a switch for zip. This prevents zip from following symlinks and going recursive on me :)

    Is there any reason why this would be a bad thing to do?

  2. falko

    falko Super Moderator Howtoforge Staff

    Thanks for the hint, we will fix this. :)
  3. erk

    erk New Member HowtoForge Supporter

    Great! Might want to add that -ry to the other zip commands in the backup script aswell. Just to be on the safe side. Symlinks can be a pain if you start to follow them...


Share This Page