LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Monitor copying backup (https://www.linuxquestions.org/questions/linux-server-73/monitor-copying-backup-566209/)

megerdin 07-03-2007 02:14 AM

Monitor copying backup
 
hi

I hv a file server and one backup. for backup I wrote a script ....

***********************
mount -t ext3 /dev/VolGroup01/LogVol00 /backup
cp -dpruv --reply=yes /All folder /backup
cp -dpruv --reply=yes /home /backup
cp -dpruv --reply=yes /etc /backup
cp -dpruv --reply=yes /etc /backup
umount /backup


......................
Its run by crontab. and looks ok and backed up everyday in specific time.


I want to copy the display report in a file when copying. So that I can see is there anything wrong in copying.

can u help me plz!!!!!!!!!!!!

p_s_shah 07-03-2007 07:10 AM

Redirect your output to /tmp/backup_log file.

Code:

# Remove old backup log file
rm -f /tmp/backup_log
# Create a new backup log file
touch /tmp/backup_log

#Script
mount -t ext3 /dev/VolGroup01/LogVol00 /backup
cp -dpruv --reply=yes /All folder /backup >> /tmp/backup_log
cp -dpruv --reply=yes /home /backup >> /tmp/backup_log
cp -dpruv --reply=yes /etc /backup >> /tmp/backup_log
cp -dpruv --reply=yes /etc /backup >> /tmp/backup_log
umount /backup


megerdin 07-04-2007 07:03 AM

Thanks a lot for helping me its working nice


All times are GMT -5. The time now is 03:43 PM.