crontab
* * * * * /temp/feroz/daemon/sync_ec2_s3.sh >> /temp/feroz/daemon/cronlog.txt 2>/temp/feroz/daemon/cronlog.error.txt
cron script /temp/feroz/daemon/sync_ec2_s3.sh
#!/bin/sh
cd /temp/feroz/daemon
/usr/local/bin/perl sync_ec2_s3.pl -vx
sync_ec2_s3.pl
my $cmd = "aws s3 cp $lockfile $s3_lockfile";
print "Step 1 $cmd \n";
my $rc = system($cmd);
print "SUCCESS <$rc> \n";
If
sync_ec2_s3.shis executed via cron as shown above,systemcommand doesn't work, and I am getting a result of-1in$rc.If script execute manually as
sh sync_ec2_s3.sh, thensystemcommands works fine.
Please help me to understand why it is not working through cron, and what I have to do to resolve