I have a small perl script that runs a command /scripts/pkgacctin cPanel with system(). The code looks like this:
print "\n/scripts/pkgacct --skiphomedir --nocompress $acc_name /my_backup\n\n";
system("/scripts/pkgacct --skiphomedir --nocompress $acc_name /my_backup");
my $bk_path = "/my_backup/cpmove-$acc_name.tar";
system("tar -xvf $bk_path -C /my_backup/");
When I run the script, backups of only the base data is stored by default cPanel roundcubeand horde. When I replace system()with exec"", the script works as expected, but exits as soon as it is executed exec, that is, subsequent instructions in the perl script are not executed. Using backticks shows the same behavior as system()- ie does not reserve all databases.
Can someone tell me what mistake I am making?
Alternatively, how can I get the rest of the instructions to execute after the command exec?
source
share