From b99691cc076ce16b73a2dea8ca119b2229083a62 Mon Sep 17 00:00:00 2001 From: Andinus Date: Thu, 27 Aug 2020 12:14:43 +0530 Subject: Warn if $tar_file exists "might overwrite" because I don't know what happens if tar fails, maybe it leaves the file untouched (?). --- leo.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'leo.pl') diff --git a/leo.pl b/leo.pl index 1493098..9f6482b 100755 --- a/leo.pl +++ b/leo.pl @@ -57,7 +57,10 @@ sub tar_create { @archive_paths = @_; } - say "Archive file: $tar_file\n"; + say "Archive file: $tar_file"; + warn "$tar_file exists, might overwrite.\n" if -e $tar_file; + print "\n"; + run3 ["/bin/tar", "cf", $tar_file, @_]; $? # tar returns 1 on errors. -- cgit 1.4.1-2-gfad0