FTPRush Cleanup Script

Sunday, October 28th, 2007

Updated: November 9th, 2007

Removes all ftprush queue items that don't download to localhost. It is useful to run if you FXP a lot of files back and forth and want to clean up the queues from time to time, but don't want to delete anything that is downloading. Feel free to make a shortcut to this script and run it any time you want.

Note that this script is only compatible with the ANSI FTPRush version. The Unicode version is not supported.

You need to have Activestate Perl installed in order to run this script. http://www.google.com/search?q=activestate+perl+download

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
50
51
52
53
54
55
56
57
#!/usr/bin/perl
#
# AUTHOR:   Artem Russakovskii
#
# URL:      http://beerpla.net
#
# DATE:     02/21/07
#
# ABSTRACT: Removes all ftprush queue items that don't download to localhost.
#           It is useful to run if you FXP a lot of files back and forth and want
#           to clean up the queues from time to time, but don't want to delete
#           anything that is downloading.
#           Feel free to make a shortcut to this script and run it any time you want.
#
#           Note that this script is only compatible with the ANSI FTPRush version.
#           The Unicode version is not supported.
#
#           You need to have Activestate Perl installed in order to run this script.
#           http://www.google.com/search?q=activestate+perl+download
 
use strict;
use Data::Dumper;
use File::Path;
use File::Find;
use Cwd;
 
my $ftprush_location = "C:\\Program Files\\FTPRush\\Queue"; # FTPRush queue location
 
sub return_file_list
{
  my @filelist;
  find(
    sub {
      if ( $File::Find::name =~ /rfq$/i )
      {
        push @filelist, $File::Find::name;
      }
    },
    $ftprush_location
  );
 
  return @filelist;
}
 
foreach(return_file_list()){
  open(FILE, $_) or die "Couldn't open $_";
  my $file = ;
  close FILE;
 
  if($file =~ /\bLocal\b/){
    print "File $_ contains localhost downloads\n";
  }
  else{
    print "Deleting $_\n";
    unlink or print "$!\n";
  }
}

Download the script here.

Can you think of a better Halloween costume this year than what these guys came up with? Lifesize iPhones, coming to a Halloween party near you. Normally, I'd say, this is dorky, but… it's just awesome. Imagine wearing this to a club, you'd be the life of the party.