Ojas has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks, Season's wishes. I am trying for a simple script which will: a) Take backup base directory and list of from command line. b) Create backup base directory and copy files into it Problem statement: 1) system ($CP, $srcfile, $dstfile) doesn't work.
if($file =~ m/\.txt$/i){ #backup to $BACKUP_BASE_DIR $dstDir = $BACKUP_BASE_DIR.$myDir; system("/bin/mkdir -p -m 755 $dstDir"); system(`/bin/cp -p $currentFile $dstDir`); print "$CP $currentFile $dstDir"; print "\n"; } else{}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dynamic Backup script
by stonecolddevin (Parson) on Dec 23, 2013 at 21:28 UTC | |
|
Re: Dynamic Backup script
by ww (Archbishop) on Dec 23, 2013 at 19:09 UTC |