Skip to content

Here, I'm going to provide the script to take a pkgacct (all accounts in cpanel) taking backup by SSH

Notifications You must be signed in to change notification settings

vinothsundararajan/Cpanel-Backup-Script.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

cPanel Backup script.

Here, i have updated the file script file called backup.sh. The below script which helps to take entire backup of cpanel accounts.

         #!/bin/bash
         IFS="$"
        
        now=$(date +"%m-%d-%Y")
        mkdir -p /mnt/backup/$now
        tempdir=/mnt/backup/$now
        targetdir=/mnt/backup
        archivefile="`date +%Y-%m-%d_%H-%M`_filename.tar"
        cd /var/cpanel/users
        
        find * | while read CPUSER; do
          echo "Now processing ${CPUSER} ..."
          /scripts/pkgacct ${CPUSER} $tempdir
          done
        # Generating single archive file
        tar -cf  ${targetdir}/${archivefile} ${tempdir}
        rm -rf $tempdir

Thank you.

About

Here, I'm going to provide the script to take a pkgacct (all accounts in cpanel) taking backup by SSH

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages