remove directories also
[BackupPC.git] / bin / BackupPC_burnArchiveCLI
index 90bd03b..d149834 100755 (executable)
@@ -278,8 +278,13 @@ sub delete_dvd($) {
 
                # remove files for this DVD
                map {
-                       print "\tremoving $_\n";
-                       unlink($_) || die "can't rm $_: $!";
+                       if (-d $_) {
+                               print "\tremoving dir $_\n";
+                               rmtree($_) || die "can't rmtree $_: $!";
+                       } else {
+                               print "\tremoving $_\n";
+                               unlink($_) || die "can't rm $_: $!";
+                       }
                } glob ( "/$iso_dir/$dvd_nr.*" );
 
                $dbh->commit;