Backup on secondary hard drive and then on NAS ?

TapanB

Active Member
Nov 29, 2004
40
0
156
Hello,

I have both secondary hard drive and NAS backup. I want to take uncompressed backups on secondary hard drive and when the cpbackup has completed i want to compress the backups on secondary hard drive and the archive which is created should be copied to NAS backup.

How to achieve this ?

Thanks.
 

TapanB

Active Member
Nov 29, 2004
40
0
156
Hi,

What i did is set cpanel to take backup on my secondary hard drive (without compression) and then I created a script with the following code:

tarname=`date +"%d_%B_%Y"`
tar pzcvf /backup.tgz /secondary/cpbackup/daily
mv /backup.tgz /mnt/nas/backups/"$tarname.tgz"

And setup a cron job at a opposite time of cpbackup to run this script:

0 23 * * * /donasbackup

Seems to be doing what I wanted to do.

Thanks.