Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import os
- import time
- now = time.time()
- prior_lock = '/home/.backup.lock'
- pstamp = os.stat(prior_lock)[9]
- if (now - pstamp) >= 604800:
- os.system("$(which rsync) -a --inplace /home/ root\@192.168.1.105:/home2/")
- os.system("$(which touch) " . pstamp)
- print "Backup complete."
- else:
- print "Backup has already run."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement