# HG changeset patch # User pitagora # Date 1404897805 14400 # Node ID 4c225e57d44b3835c30f7e5c100481c0c46e0fa1 # Parent 75dc30937969b4bc8dc3abad4af164289098cf59 Uploaded diff -r 75dc30937969 -r 4c225e57d44b export.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/export.pl Wed Jul 09 05:23:25 2014 -0400 @@ -0,0 +1,32 @@ +#!/usr/bin/perl + +use strict; +use File::Copy; +use File::Basename; + +# ARGS +my ($symlink, $dest, $logfile, @files)=@ARGV; +die("Absolute path required\n") unless $dest =~ /^\//; +die("Paths containing '..' are disallowed\n") if $dest =~ /\/\.\.\//; +die("Only /home/*, /house/*, and /ifs/* paths are allowed\n") unless $dest =~ /^\/home/ or $dest =~ /^\/house/ or $dest =~ /^\/ifs/; +die("Destination folder does not exist: $dest\n") unless -e $dest; +die("Destination path is not a folder: $dest\n") unless -d $dest; + +# CP +open(OUT, ">$logfile") or die($!); +while (@files) { + my $file=shift @files or die("Source filename required\n"); + my $name=shift @files or die("Destination filename required\n"); + print OUT "$file -> $dest/$name\n"; + if ($symlink) { + symlink($file, "$dest/$name"); + } else { + copy($file, "$dest/$name"); + } +} +close OUT; +print "Exported ", scalar(@files), " to $dest\n"; +exit; +__END__ +Copyright (c) 2011 US DOE Joint Genome Institute. +Use freely under the same license as Galaxy itself. diff -r 75dc30937969 -r 4c225e57d44b export.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/export.xml Wed Jul 09 05:23:25 2014 -0400 @@ -0,0 +1,29 @@ + +to a Local File +export.pl $symlink $dest $logfile +#for $i in $files +${i.file} ${i.name} +#end for + + + + + + + + + + + + + + + + +**What it does** + +This tool allows staff to export files from Galaxy to a specified NFS path. + +The destination folder must be writable by the Galaxy user. It is suggested that you create a folder ~/dropbox and chmod 777 it. + + diff -r 75dc30937969 -r 4c225e57d44b link_path.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/link_path.pl Wed Jul 09 05:23:25 2014 -0400 @@ -0,0 +1,38 @@ +#!/usr/bin/perl + +# INTERNAL USE ONLY! +# THIS TOOLS IS WRITTEN BASED ON link_path.pl FROM US DOE Joint Genome Institute. +# 2012-02-10 Yamanaka + +# THIS TOOL HAS BEEN DEPRECATED IN FAVOR OF THE galaxy_import.pl AND gcpd.pl METHOD +# WHICH DON'T REQUIRE SETTING METADATA MANUALLY FOR EACH FILE. + +use strict; +use File::Copy; + +# CONFIG +my @allowed_paths = ('/'); + +# ARGS +my ($src, $dest, $symlink)=@ARGV; +die("Absolute path required\n") unless $src =~ /^\//; +die("Paths containing '..' are disallowed\n") if $src =~ /\/\.\.\//; +my $ok=0; +foreach my $dir (@allowed_paths) { + my $re="^$dir"; + $re =~ s/\//\\\//g; + if ($src =~ /$re/) { + $ok=1; + last; + } +} +die("Not an allowed source path\n") unless $ok; + +# CP +unlink($dest); +if ($symlink) { + symlink($src, $dest); +} else { + copy($src,$dest); +} +exit; diff -r 75dc30937969 -r 4c225e57d44b link_path.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/link_path.xml Wed Jul 09 05:23:25 2014 -0400 @@ -0,0 +1,18 @@ + +a Local File +link_path.pl $source $dest $symlink + + + + + + + + + + + +This tool allows you to import a local file into Galaxy. +You have to edit the imported file's metadata to assign it to the appropriate datatype. + +