#!/usr/bin/perl #config info #cameras mnt point $cammnt = "/mnt/film/"; #camera pictures directory $camdir = "/mnt/film/dcim/100olymp/"; #Directory to save the pictures to $dir = "/mnt/backup/Picz/digcampictures/new/"; my $output = `date`; $output =~ tr/ /_/; $output =~ tr/:/-/; print "\n\n\n$output\n"; my @zebra = split('_',$output); my $mp = "/mnt/film/"; my $MOUNT = $mp; my $dir2 = $dir . glob($zebra[$#zebra]); my $dir3 = "$dir2/$$zebra[1]-$zebra[3]_$zebra[4]"; my $fail = 0; open(MOUNT, $MOUNT) or die "cannot open $MOUNT: $!"; if (system('mount', $mp) != 0) { warn "could not mount $mp, aborting\n"; $fail = 1; print "pp"; } else { $fail = 0; } if ($fail) { print "failed"; } else { print "your a winner"; open(ls,"|ls $camdir") or die "errorrr"; close(ls); print "\n$dir$output\n"; open(makdir,"|mkdir $dir2") or die "errorrr"; close(makdir); open(makdir,"|mkdir $dir3") or die "errorrr"; close(makdir); open(mv,"|mv -f $camdir*.* $dir3") or die "errorrr"; close(mv); system "cd $dir$output"; system "pwd"; } system('umount', $mp) && warn "could not umount\n"; exit;