want perl to output shell commands verbose
I've been working on a little backup script that copies and entire drive to a directory and then runs a virus scan on that directory. I cannot get perl to output copy progress to the screen. Essentially I want the effect of "cp -R -v /source /dest" if I were at the command prompt. Here is my code:
#backup.pl
use Shell qw(cp cat df chmod mkdir mount freshclam clamscan);
cp ("-v", "-R", "$source", "$dest");
clamscan ("$dest", "--remove", "--recursive", "-l", "$path/logs/$folder.log");
I've tried variations such as
print cp ("-v", "-R", "$source", "$dest");
cat cp ("-v", "-R", "$source", "$dest");
... and still no luck.
It'd be nice to have the clamscan command do the same. I'm not a regular perl programmers, so any suggestions would be useful.
Thanks!
|