SimpleSync Archive Option Fix

Issue

Aspera's SimpleSync script has a bug that keeps the archive function from working. For more information on the developer tool SimpleSync, see the Aspera Developer Network.

Solution

First, in the configuration file, there must be a post_process section that looks like the following:

<post_process>
     <delete_dirs>1</delete_dirs>
     <archive_dir>/home/aspera/archive</archive_dir>
     <action>move</action>
</post_process>

There are also four entries in the Perl script (../bin/aspsimplesync.pl) that need to be corrected. The script has these four object attributes as archive, but the actual attribute is: archive_dir. So the following:

sub create_postprocess
{
    my ($args) =  @_;
 
    # Archive file function
    if(defined($args->{'archive'})) {
        unless(-d $args->{'archive'}) {
            die "post_process: Error $args->{'archive'} $!\n";
        }
        return sub {
            my $file = shift;
            eval
            {
 
                archive_file($file, $args->{'archive'},
                    {
                        overwrite => $args->{'overwrite'},
                        action => $args->{'action'},
                        base => exists ($args->{'base'}) ? $args->{'base'} :
                            $args->{'path'},
                        delete_dirs => $args->{'delete_dirs'},
                        nowarn      => 1,
                    }
                )
            };
            return 1 unless($@);
            &asp_logger("post_process: $@","ERR");
            return 0;
        };
    }

should be changed to:

sub create_postprocess
{
    my ($args) =  @_;
 
    # Archive file function
    if(defined($args->{'archive_dir'})) {
        unless(-d $args->{'archive_dir'}) {
            die "post_process: Error $args->{'archive_dir'} $!\n";
        }
        return sub {
            my $file = shift;
            eval
            {
 
                archive_file($file, $args->{'archive_dir'},
                    {
                        overwrite => $args->{'overwrite'},
                        action => $args->{'action'},
                        base => exists ($args->{'base'}) ? $args->{'base'} :
                            $args->{'path'},
                        delete_dirs => $args->{'delete_dirs'},
                        nowarn      => 1,
                    }
                )
            };
            return 1 unless($@);
            &asp_logger("post_process: $@","ERR");
            return 0;
        };
    }

 

 

 

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk