I recently designed a php script to do small administrative tasks on a home backup server. The testing for the script was done on FreeBSD 6.2 with Apache 2.2 and PHP 5.2.1 The backup software was Rsnapshot 1.3.0
I don’t see many people needing this kind of script but if you want to dive in and try to use it the source can be found here: backupfe.phps
The script was not designed with security in mind. If you use this script, only use it on a trusted private network. In order for the script to work properly a couple of configurations for Apache need to be changed.
- You must change the user and group Apache is run as. This can be done in the httpd.conf file.
- The user Apache is run as must have access to specific commands, this can be configured via sudo.
The specific commands this user must have access to are (taken from visduo):
ALL=NOPASSWD: /sbin/mount, /usr/sbin/mount_smbfs, /sbin/umount, /sbin/ifconfig, /sbin/reboot,
The script does no error checking so what you see is what you get. It’s just a simple script to make my life easier, and that’s the way I like it.