Skip to main content

Restoring cpanel full backup using PHP

Comments

2 comments

  • KostonConsulting
    Couple of notes: 1. I really hope that /public_html/wma/modules/backup/files/ is locked down. It would be really bad to backup user files to a web accessible directory. A lot of backups contain databases which means you'd be potentially putting password hashes and credit card numbers out on the public web. 2. It's likely a bad idea to restore backups from within user home directories. Once the backup is created, the user could modify it to change their account plan, privileges, etc. It's a lot safer to use system backups or /scripts/pkgacct and keep the backup archives out of the hands of users either in /home/cpmove-$user.tar.gz files or in a backup parition/directory using the built-in backup system. As far as restoring backups via API goes, you need to use the XML/JSON restoreaccount API call: [url=http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/RestoreAccount]RestoreAccount < SoftwareDevelopmentKit < TWiki I'd urge you to create backups using the Backup Configuration section of WHM, or with /scripts/pkgacct as it's inherently unsafe to trust anything provided to you from within a user's home directory.
    0
  • z-hoster
    Thanks for you help. I am doing this for a client that asked to have control on his backups from his administration panel. I got the directory secured with htaccess and i know i can trust the client. I took a look at the fonction you gave but it's not usable for what i want to do. Theres only 3 options in "type" (monthly, weekly, daily) In my case i would need to select something like "custom" and provide the full path to the backup file but thats not possible. I really hope using server commands is not the only way ... it would really sux to have to enable them. This is a script i found that does it using systeme()
    0

Please sign in to leave a comment.