DX

来源:互联网 发布:剑三丐帮正太捏脸数据 编辑:程序博客网 时间:2024/04/27 19:29
#!/usr/bin/perl -w
use strict;

sub printUsage()
{
    printf STDERR "Usage: ./dx.pl config.xml\n";
}

if($#ARGV < 0)
{
    &printUsage();
    exit 1;
}

#my $cmd = qq(su - collect -c \"/usr/bin/perl /home/collect/datax/dx.pl $ARGV[0]\");

my $username = $ARGV[0];
shift @ARGV;

my $cmd = qq(source /etc/profile
source /etc/bashrc
kinit -kt /opt/horae/$username\.keytab $username
cd /home/collect/datax
./datax_hadoop jar datax.jar $ARGV[0]
);

#system($cmd);

my $res =  (system($cmd) >> 8 ? 1 : 0);
#printf STDOUT $res."\n";

exit $res;



===

#!/usr/bin/perl -w
use strict;

sub printUsage()
{
        printf STDERR "Usage: ./wget.pl config.xml\n";
}

if($#ARGV < 0)
{
        &printUsage();
        exit 1;
}

#my $cmd = "su - collect; cd /home/collect/wgetadapter; java -Djava.ext.dirs=lib:$ENV{'JAVA_HOME'}/jre/lib/ext/ -jar wget.jar $ARGV[0]";

my $cmd = qq(su - collect -c \"/usr/bin/perl /home/collect/wgetadapter/wget.pl $ARGV[0]\");
exit (system($cmd) >> 8);


原创粉丝点击