mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #274 from dpryan79/dev
Add usage information to python cleanup scripts
This commit is contained in:
Regular → Executable
+5
-1
@@ -74,7 +74,8 @@ def main():
|
||||
contains the specified text will be marked as deleted in user's history and
|
||||
the user will be notified by email using the specified template file.
|
||||
"""
|
||||
parser = OptionParser()
|
||||
usage = "usage: %prog [options] galaxy.ini"
|
||||
parser = OptionParser(usage=usage)
|
||||
parser.add_option("-d", "--days", dest="days", action="store",
|
||||
type="int", help="number of days (60)", default=60)
|
||||
parser.add_option("--tool_id", default=None,
|
||||
@@ -100,6 +101,9 @@ def main():
|
||||
help="From address to use to send email. "
|
||||
"Default: [read from galaxy ini file]")
|
||||
(options, args) = parser.parse_args()
|
||||
if len(args) != 1 :
|
||||
parser.print_help()
|
||||
sys.exit()
|
||||
ini_file = args[0]
|
||||
|
||||
config_parser = ConfigParser.ConfigParser({'here': os.getcwd()})
|
||||
|
||||
Regular → Executable
+5
-1
@@ -66,7 +66,8 @@ def main():
|
||||
Another way of stating it is: LibraryDatasetDatasetAssociation objects map LibraryDataset objects to Dataset objects,
|
||||
and Dataset objects may be mapped to History objects via HistoryDatasetAssociation objects.
|
||||
"""
|
||||
parser = OptionParser()
|
||||
usage = "usage: %prog [options] galaxy.ini"
|
||||
parser = OptionParser(usage=usage)
|
||||
parser.add_option( "-d", "--days", dest="days", action="store", type="int", help="number of days (60)", default=60 )
|
||||
parser.add_option( "-r", "--remove_from_disk", action="store_true", dest="remove_from_disk", help="remove datasets from disk when purged", default=False )
|
||||
parser.add_option( "-i", "--info_only", action="store_true", dest="info_only", help="info about the requested action", default=False )
|
||||
@@ -79,6 +80,9 @@ def main():
|
||||
parser.add_option( "-6", "--delete_datasets", action="store_true", dest="delete_datasets", default=False, help="mark deletable datasets as deleted and purge associated dataset instances" )
|
||||
|
||||
( options, args ) = parser.parse_args()
|
||||
if len(args) != 1 :
|
||||
parser.print_help()
|
||||
sys.exit()
|
||||
ini_file = args[0]
|
||||
|
||||
if not ( options.purge_folders ^ options.delete_userless_histories ^ \
|
||||
|
||||
Regular → Executable
+12
@@ -22,7 +22,19 @@ from sqlalchemy import *
|
||||
|
||||
assert sys.version_info[:2] >= ( 2, 4 )
|
||||
|
||||
def usage(prog) :
|
||||
print "usage: %s galaxy.ini" % prog
|
||||
print """
|
||||
Populates blank uuid fields in datasets with randomly generated values.
|
||||
|
||||
Going forward, these ids will be generated for all new datasets. This
|
||||
script fixes datasets that were generated before the change.
|
||||
"""
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 2 or sys.argv == "-h" or sys.argv == "--help" :
|
||||
usage(sys.argv[0])
|
||||
sys.exit()
|
||||
ini_file = sys.argv.pop(1)
|
||||
config = get_config(ini_file)
|
||||
|
||||
|
||||
Regular → Executable
+14
@@ -8,7 +8,21 @@ import sys, os
|
||||
|
||||
assert sys.version_info[:2] >= ( 2, 4 )
|
||||
|
||||
def usage(prog) :
|
||||
print "usage: %s file" % prog
|
||||
print """
|
||||
Removes a set of files from disk. The input file should contain a list of files
|
||||
to be deleted, one per line. The full path must be specified and must begin
|
||||
with /var/opt/galaxy.
|
||||
|
||||
A log of files deleted is created in a file with the same name as that input but
|
||||
with .removed.log appended.
|
||||
"""
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 2 or sys.argv == "-h" or sys.argv == "--help" :
|
||||
usage(sys.argv[0])
|
||||
sys.exit()
|
||||
infile = sys.argv[1]
|
||||
outfile = infile + ".removed.log"
|
||||
out = open( outfile, 'w' )
|
||||
|
||||
Regular → Executable
+15
@@ -8,7 +8,22 @@ import sys, os
|
||||
|
||||
assert sys.version_info[:2] >= ( 2, 4 )
|
||||
|
||||
def usage(prog) :
|
||||
print "usage: %s file" % prog
|
||||
print """
|
||||
Marks a set of files as purged and renames them. The input file should contain a
|
||||
list of files to be purged, one per line. The full path must be specified and
|
||||
must begin with /var/opt/galaxy.
|
||||
A log of files marked as purged is created in a file with the same name as that
|
||||
input but with _purged appended. The resulting files can finally be removed from
|
||||
disk with remove_renamed_datasets_from_disk.py, by supplying it with a list of
|
||||
them.
|
||||
"""
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 2 or sys.argv == "-h" or sys.argv == "--help" :
|
||||
usage(sys.argv[0])
|
||||
sys.exit()
|
||||
infile = sys.argv[1]
|
||||
outfile = infile + ".renamed.log"
|
||||
out = open( outfile, 'w' )
|
||||
|
||||
Regular → Executable
+10
@@ -9,7 +9,17 @@ import galaxy.app
|
||||
|
||||
assert sys.version_info[:2] >= ( 2, 4 )
|
||||
|
||||
def usage(prog) :
|
||||
print "usage: %s galaxy.ini" % prog
|
||||
print """
|
||||
Updates the dataset.size column. Users are advised to backup the database before
|
||||
running.
|
||||
"""
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 1 or sys.argv[1] == "-h" or sys.argv[1] == "--help" :
|
||||
usage(sys.argv[0])
|
||||
sys.exit()
|
||||
ini_file = sys.argv.pop(1)
|
||||
conf_parser = ConfigParser.ConfigParser( {'here':os.getcwd()} )
|
||||
conf_parser.read( ini_file )
|
||||
|
||||
Regular → Executable
+11
@@ -13,7 +13,18 @@ import galaxy.datatypes.tabular
|
||||
|
||||
assert sys.version_info[:2] >= ( 2, 4 )
|
||||
|
||||
def usage(prog) :
|
||||
print "usage: %s galaxy.ini" % prog
|
||||
print """
|
||||
Updates the metadata in the database to match rev 1981.
|
||||
|
||||
Remember to backup your database before running.
|
||||
"""
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 1 or sys.argv[1] == "-h" or sys.argv[1] == "--help" :
|
||||
usage(sys.argv[0])
|
||||
sys.exit()
|
||||
ini_file = sys.argv.pop(1)
|
||||
conf_parser = ConfigParser.ConfigParser({'here':os.getcwd()})
|
||||
conf_parser.read(ini_file)
|
||||
|
||||
Reference in New Issue
Block a user