my $worker = Gearman::Worker->new;
$worker->job_servers('127.0.0.1:4730');
+open(my $log, '>>', '/rsync1/s1/log/send_file.log');
+select($log); $|++;
+
$worker->register_function( send_file => sub {
my ($job) = @_;
make_path $t_basedir unless -d $t_basedir;
link $f_dir . $from => $t_dir . $to;
+ print "send#$work#", -s $t_dir.$to, "#$!\n";
+
die "ERROR: $!" if $!;
return "send_file $f_dir $from -> $t_dir $to";
my $full = $dir . $work;
if ( -d $full ) {
+ print "delete_tree#$work\n";
warn "remove_tree $full\n";
remove_tree $full;
} else {
+ print "delete_file#$work#", -s $full, "\n";
warn "unlink $full\n";
+ unlink $full;
}
if ( $! ) {
warn "ERROR: $!";