Source

rsync_backup / rsync_backup_daemon.py

Diff from to

rsync_backup_daemon.py

 import time
 import subprocess
 
-from rsync_backup import backup, cmd
+from rsync_backup import backup
+from exec_cmd import exec_shell as cmd
 from fs import mount_pathes, umount_pathes, mount, umount
 from smb import send_msg
 
 
 def pre_backup():
     """do stuff before the backup begins"""
-    send_msg("backup starts in 60s...", MSG_HOST)
+    #send_msg("backup starts in 60s...", MSG_HOST)
     time.sleep(60)
     mount(BACKUP_DEV, BACKUP_MOUNTPOINT)
     mount_pathes(PATHES, ROOTFS)
     """do stuff after the backup finished"""
     umount_pathes(PATHES, ROOTFS)
     umount(BACKUP_MOUNTPOINT)
-    send_msg("backup ended", MSG_HOST)
+    #send_msg("backup ended", MSG_HOST)
 
 
 def do_backup():
             backup(SRC, DST, GENERATIONS, stdout=logfile, stderr=subprocess.STDOUT)
             post_backup()
         except Exception as err:
-            send_msg("backup crashed!", MSG_HOST)
-            #logfile.write("Backup crashed, Exception:\n")
-            #logfile.write(str(err))
+            #send_msg("backup crashed!", MSG_HOST)
+            logfile.write("Backup crashed, Exception:\n")
+            logfile.write(str(err))
             raise