Home » Tutorial » 17 August 2021 » » No Comment »

Simple shell script loop for cpanel backup

17 August 2021 No Comment

I wrote the simple script loop for cpanel backup with –skiphomedir option. This is useful for my own note.

The script is very simple. It just does loop cpanel backup with –skiphomedir option. It is very useful to back up cpanel account configuration with MySQL databases. If you want to just back up databases, head over to this link here.

#!/bin/bash
# Shell script to back up cpanel account with --skiphomedir option

for i in `ls -A /var/cpanel/users` ; 
do /usr/local/cpanel/scripts/pkgacct --skiphomedir $i /backup/skiphomedir ;

done

You can also just run the command without to use the script. The reason I write the script is that I want to use it on the cron job.




Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.