Browse Source

Mychanges (#14)

* updated the naming of output directory

* changed file naming
master
Gerry Nelson 7 years ago
committed by GitHub
parent
commit
f368e8bf52
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      exportfoldertree.py

13
exportfoldertree.py

@ -42,15 +42,18 @@ clidir='/opt/sas/viya/home/bin/'
# get input parameters
parser = argparse.ArgumentParser(description="Delete a folder and its sub-folders")
parser = argparse.ArgumentParser(description="Export the complete Viya folder tree")
parser.add_argument("-d","--directory", help="Directory for Export",required='True')
args= parser.parse_args()
basedir=args.directory
# create output directory
now=time.localtime()
dirname="D_"+time.strftime('%Y-%m-%dT%H:%M:%S',now)
path=os.path.join(basedir,dirname)
# create output directory: was giving the directory a name
#now=time.localtime()
#dirname="D_"+time.strftime('%Y-%m-%dT%H:%M:%S',now)
#path=os.path.join(basedir,dirname)
# I now just use the directory the user specifies
path=basedir
if not os.path.exists(path): os.makedirs(path)
# retrieve root folders

Loading…
Cancel
Save