We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c765e24 commit d9089d4Copy full SHA for d9089d4
backups-lib.pl
@@ -498,9 +498,18 @@ sub backup_domains
498
&$first_print($files);
499
next;
500
}
501
- my ($already) =
502
- grep { lc($_->{'path_display'}) eq lc("/".$server) }
503
- @$files;
+ my $already;
+ if ($server) {
+ # If backing up to a folder, list contents to
504
+ # see if it already exists
505
+ my $contents = &list_dropbox_files("/".$server);
506
+ $already = 1 if (ref($contents));
507
+ }
508
+ if (!$already) {
509
+ # Fall back to listing the parent dir to look
510
+ # for the destination folder
511
+ ($already) = grep { lc($_->{'path_display'}) eq lc("/".$server) } @$files;
512
513
if (!$already) {
514
my $err = &create_dropbox_dir("/".$server);
515
if ($err) {
0 commit comments