BASH   34

backup.sh

Guest on 8th May 2022 07:08:14 AM

  1.  
  2. #!/bin/bash
  3. #
  4. # backup.sh
  5. #Script to copy files from server to backup machine
  6. # Version 1.0 - March/04
  7. #
  8. #
  9. SYNC_LOG=/var/log/rsync.log # location where the log file will be stored
  10. # Log entry delimiter
  11. echo "******************************" >> $SYNC_LOG
  12. date >> $SYNC_LOG
  13. echo "Start of synchronization" >> $SYNC_LOG
  14. rsync -avz root@remote_machine:/data_source/ /data_destination/ >>
  15. $SYNC_LOG
  16. echo "End of sync" >> $SYNC_LOG
  17. echo "******************************" >> $SYNC_LOG

Raw Paste


Login or Register to edit or fork this paste. It's free.