From ecf1581cfde9e4872d28a77baac7b3ceafcacf7a Mon Sep 17 00:00:00 2001 From: Andinus Date: Thu, 27 Aug 2020 18:55:17 +0530 Subject: Remove date from archive files, add date to archive directory This format is better than keeping lots of files in a single directory. --- leo.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'leo.pl') diff --git a/leo.pl b/leo.pl index cd6a297..c208169 100755 --- a/leo.pl +++ b/leo.pl @@ -19,8 +19,8 @@ $options{sign} = $ENV{LEO_SIGN}; $options{delete} = $ENV{LEO_DELETE}; my $gpg_fingerprint = "D9AE4AEEE1F1B3598E81D9DFB67D55D482A799FD"; -my $archive_dir = "/tmp/archive"; my $ymd = ymd(); # YYYY-MM-DD. +my $archive_dir = "/tmp/archive/$ymd"; path($archive_dir)->mkpath; # Create archive directory. my $prof; @@ -56,7 +56,7 @@ foreach my $arg ( @ARGV ) { if $prof eq "journal" and $options{encrypt}; # Deref the array here because we want flattened list. - archive("$archive_dir/${arg}_$ymd.tar", $profile{$arg}->@*); + archive("$archive_dir/${arg}.tar", $profile{$arg}->@*); $options{encrypt} = $tmp if $prof eq "journal"; } else { -- cgit 1.4.1-2-gfad0