Last active
November 6, 2016 16:00
-
-
Save inetbiz/c111b51f1b0f77f107172834f6665712 to your computer and use it in GitHub Desktop.
Backup cpanel accounts without the docroot files ( public_html) to backup drive. https://www.google.com/+StrikehawkeComm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Custom Backup script created by strikehawk.com | |
# https://www.google.com/+StrikehawkeComm | |
# Version 0.2-beta | |
# Are we already runnig? Twice runs is bad thing | |
if [ -f /tmp/custombackup.flag ]; then echo "Already running!"; exit 2; fi | |
# Flag is indicating, that we running | |
touch /tmp/custombackup.flag | |
name=$1 | |
day=`date +%d` | |
month=`date +%m` | |
year=`date +%Y` | |
# If '/backup' is not present in mtab - trying to mount it. If mount fails - exiting with emergancy status. | |
grep '/backup' /etc/mtab || mount /dev/sdb1 /backup || exit 3 | |
# Package the account of $name1 | |
/scripts/pkgacct --skiphomedir --userbackup $name /backup/pluto/${year}-${month}-${day}/accounts/ | |
# We are finished | |
rm -f /tmp/custombackup.flag |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment