-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
executable file
·49 lines (36 loc) · 1.36 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""
Python file backup utility
"""
import diffBackup
import createISO
import clean
import os
# ignoreList = {".pdf":1} #write paths of files, folders and extensions here which we don't want to copy
# ignoreList = {"/Users/dhruvmullick/CS/Project Work/python-backup-utility/srcFolder/gaddaarChetan.py":1}
# ignoreList = {"/Users/dhruvmullick/CS/Project Work/python-backup-utility/srcFolder/MyFolder":1}
# ignoreList={}
def Backupnow(L,dst,ignoreList):
# Make a completely fresh backup
# delete the files already there at dst, as this is a fresh backup.
#
# clean.readyDst(dst)
# copyFiles.copyFull(src,dst,ignoreList)
# Make a differential backup
for src in L:
if src=='':
continue
dstt=os.path.join(dst,os.path.basename(src))
(LC,LD) = diffBackup.mainDiffBackup(src,dstt,ignoreList)
print 'src files: '
for s in L:
print s+'\n'
# print 'dst files: '+dst
# print 'Main'
# print LC
# print LD
# Create an isoimage of the backup folder
# isodstfolder = "/Users/dhruvmullick/CS/Project Work/python-backup-utility/" #folder where iso image is to be saved. Take input from user.
# backupdst=dst # Folder of which we have to make backup
# createISO.isoCreator(backupdst,isodstfolder)
print "\n\nBackup has been created successfully. Thank you. \n\n"
return (LC,LD)