Problem running the python code for backup on Ubuntu?
- by Akash
I was trying to run following python code through terminal but something is wrong as it is producing some errors
source = ['/home/akash/', '/home/akash/code']
target_dir = '/media'
target = target_dir + os.sep + time.strftime('%Y%m%d%H%M%S') + '.zip'
zip_command = "zip -qr {0} {1}".format(target, ' '.join(source))
if os.system(zip_command) == 0:
print('Successful backup to', target)
else:
print('Backup FAILED')
but when i try to run it following error appears
zip I/O error: Permission denied
zip error: Could not create output file (/media/20131019083404.zip)
Backup FAILED