Development notes
This module is designed to run in the following modes:
1. Backup. This archives a specific directory (or list) to a given data archive project.
2. Remove. This checks that directories are in the archive and then deletes them according to some criteria.
du testing
-> parse ^(\d+)\s_\S.+$' -> size, directory
ls -lt | head -2
total 60
drwxr-xr-x. 3 z3452659 unsw 4096 Mar 30 16:40 tools
-> Store this for each directory: should not change between upload check.
ls -1p dev | grep "/$" -cv -> Number of files
ls -1p dev | grep "/$" -c -> Number of directories
module add unswdataarchive/2015-09-10
upload.sh /home/z3452659/bioinf/redwards/projects/ManefieldPacBio-Sep15 "/UNSW_RDS/D0234444/"
NOTE: Will need to get the system set up so that it does not ask for a password. This can be achieved by requesting
a token from IT and then updating the config file.
The first time it runs, it will report X imported file(s). If the files are already uploaded, it will report 0 files
imported. All files are listed in "Consume" lines, though. This should (presumably) match the number of files listed
by ls with the -a flag, ignoring '.' and '..'? Or could try matching against:
rje.listDir(callobj=None,folder=os.getcwd(),subfolders=True,folders=True,files=True,summary=True,asksub=False,dircut=0,dirdepth=-1
)
=> Make checking file numbers a toggle. (checknum=T/F
)
$ upload.sh /srv/scratch/z3452659/CaneToad-May15/analysis/2016-11-22.Tyr "/UNSW_RDS/D0234445/CaneToad-May15/analysis"
Picked up _JAVA_OPTIONS: -Xmx1g
Password:
Consume: 2016-11-22.Tyr/BLASTFAS/F7CL37.fas [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/canetoad.20161122A.tyr_XENTR.vs.canetoad.20161122A.est_hits.fas [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/fiesta.ini [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/fiesta.log [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/gablam.log [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.fas [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.fas.nhr [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.fas.nin [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.fas.nog [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.fas.nsd [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.fas.nsi [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.fas.nsq [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.gablam.tdt [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.hitsum.tdt [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.local.tdt [construct: null, logical: null, encapsulation: null]
live: imported 15 file(s)
$ upload.sh /srv/scratch/z3452659/CaneToad-May15/analysis/2016-11-22.Tyr "/UNSW_RDS/D0234445/CaneToad-May15/analysis"
Picked up _JAVA_OPTIONS: -Xmx1g
Password:
Consume: 2016-11-22.Tyr/canetoad.20161122A.tyr_XENTR.vs.canetoad.20161122A.est_hits.fas [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/BLASTFAS/F7CL37.fas [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/fiesta.ini [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/fiesta.log [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/gablam.log [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.fas [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.fas.nhr [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.fas.nin [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.fas.nog [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.fas.nsd [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.fas.nsi [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.fas.nsq [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.gablam.tdt [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.hitsum.tdt [construct: null, logical: null, encapsulation: null]
Consume: 2016-11-22.Tyr/tyr_XENTR.vs.canetoad.20161122A.local.tdt [construct: null, logical: null, encapsulation: null]
live: imported 0 file(s)
#!# Should generate a log file that has the time, total number of files and total number imported.
.name' failed: The namespace '/UNSW_RDS/D0234445/CaneToad-May15/delete' does not exist or is not accessible
History Module Version History
# 0.0.0 - Initial Compilation.
# 0.1.0 - Initial (partially) functional version.
# 0.2.0 - Updated functions with additional status measures and backups/archives division.
# 0.2.1 - Fixed float division error.
# 0.3.0 - Modified default homepath. Renamed backups to backupdb.
# 0.3.1 - Fixed backups/backupdb bug.
# 0.4.0 - Replaced module with uploadsh=X Full path for runnining upload.sh script ['/share/apps/unswdataarchive/2015-09-10/']
# 0.4.1 - Added tryparent=T/F : Whether to try to run backup parent directory in case of failure [True]
# 0.5.0 - Updated to run on Mac with OSX=T.
# 0.6.0 - Added toggle to skip quiet created/updated/modified.
# 0.7.0 - Added maxfiles cap and option to targz directories exceeding threshold.
# 0.7.1 - Set checkarchive=F tryparent=F by default to make standard running quicker.
# 0.7.2 - Added maxdirsize=INT : Maximum directory size in bytes to generate backup [1e11 (~100Gb)]
# 0.7.3 - Python 2.6 compatibility.