in reply to How I move files and check if they exit in another directory?

The thing is that I want the script to check if the file is already in the backup disk in order to only copy files that are missing.

Don't you also want to copy files that exist on the backup disk but have changed since the last time they were backed up? Backup is an often underestimated topic in terms of complexity, and while I wouldn't want to discourage you from writing a program for the learning experience alone, I am fairly sure that what you will produce is not as suitable for the task as existing tools out there. If you want to use Perl for this, I'd suggest searching for "backup" on CPAN and taking a look at the modules shown. Otherwise, check out unison which is a fairly light-weight yet complete way of doing what you're trying to do.


All dogma is stupid.