echo weekly backup started `date '+%Y-%m-%d/%k-%M'` > /var/log/backup/weekly.log
tar -cjvf something.tar.bz2 /directory
echo weekly backup completed `date '+%Y-%m-%d/%k-%M'` >> /var/log/backup/weekly.log
If I cat the content of /var/log/backup/weekly.log file the actual time is taken 5 hours 30 minutes for compressing and given 38GB *.bz2 file.
But for sending that 38GB *.bz2 file to some other server it is taking around only 25 minutes. for that the shell script as below
echo weekly backup sending to someserver `date '+%Y-%m-%d/%k-%M'` > /var/log/backup/nfsweekly.log
scp /directory/*.bz2 root@IP_Addr:/directory
echo weekly backup sent to someserver `date '+%Y-%m-%d/%k-%M'` >> /var/log/backup/nfsweekly.log
If you are posting scripts longer than one line please bracket them using the code ... /code surrounded by square brackets. That makes things easier to read as you can see from the above example.