Skip to content

Instantly share code, notes, and snippets.

@pmakholm
Created August 16, 2013 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmakholm/6250172 to your computer and use it in GitHub Desktop.
Save pmakholm/6250172 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use Parallel::ForkManager;
my $pm = Parallel::ForkManager->new(8);
for my $file (glob "/usr/local/backup/*") {
my $pid = $pm->start and next;
print "Attempting to copy $file\n";
system("/usr/local/bin/rsync --progress --modify-window=1 -ruivtO /usr/local/backup/$file /remotedisk/disk1/");
$pm->finish;
}
$pm->wait_all_children;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment