I have write a simple shell script to show how many backup have been created for the account and listing the backup. The script is for my own use and my own note. I is very usefull if you have many backup and want simpler way to check the backup availability instead using WHM.

# Shell script to check backup availability

echo ""
echo Shell script to check backup availability
read -p 'Username: ' username
echo There are
find /backup/*/*/accounts/ -maxdepth 1 -name $username* | wc -l
echo Backup available for $username
echo ""
echo Backup available for $username as below :
echo "Weekly"
ls -lath /backup/weekly/*/accounts/$username*
echo "Monthly"
ls -lath /backup/monthly/*/accounts/$username*

Output :
[[email protected] backup]# ./

Shell script to check backup availability
Username: inertz
There are
Backup available for inertz

Backup available for inertz as below :
-rw------- 1 root root 3.6G Nov  5 10:47 /backup/weekly/2022-11-05/accounts/inertz.tar.gz
-rw------- 1 root root 3.6G Oct 15 10:57 /backup/monthly/2022-10-15/accounts/inertz.tar.gz

Leave a Reply

Your email address will not be published. Required fields are marked *

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.