Skip to content

Instantly share code, notes, and snippets.

@inetbiz
Last active November 6, 2016 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inetbiz/c111b51f1b0f77f107172834f6665712 to your computer and use it in GitHub Desktop.
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
#!/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