-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackup.py
More file actions
21 lines (18 loc) · 737 Bytes
/
Copy pathbackup.py
File metadata and controls
21 lines (18 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#python script to create a back up of system to a disk image
#os.system commands commented out for testing purposes; remove comment out once successfully tested
#comment out print statements while enabling os.systm commands
import os, time, datetime
now = datetime.datetime.now()
backup = raw_input ('Backup system files? (Y/N)\n\r')
if backup == 'Y':
print 'Backing up WarPi system files now...'
time.sleep(1)
os.system('cd /home/')
time.sleep(2)
os.system('sudo tar czf pi_home.tar.gz pi')
#print 'backup command invocation' #enable to debug code
time.sleep(1)
print 'WarPi successfully backed up to /home directory on ' + now.strftime('%b %d, %Y %H:%M')
else:
print 'Consider backup up WarPi system files'
time.sleep(.5)