Don't use ':' in backup directory names
':' is not allowed on FAT/exFAT filesystems, so backups to such drives failed. Use '%Y-%m-%d_%H-%M-%S' instead; existing backups with the old format still sort correctly. Document the limitations of FAT/exFAT in the man page.
This commit is contained in:
+9
-1
@@ -52,7 +52,15 @@ or to use single or double quotes around them.
|
||||
.B \-o, \-\-output DIR
|
||||
Specify the directory where the files will be copied. The program will automatically
|
||||
create a subdirectory called \(aqsimple_backup\(aq (if it does not already exist) and
|
||||
inside this directory the actual backup directory (using the current date and time).
|
||||
inside this directory the actual backup directory (using the current date and time, for example
|
||||
\(aq2026\-10\-08_17\-34\-47\(aq).
|
||||
.RS
|
||||
.P
|
||||
Backups are best stored on a Linux filesystem (e.g. ext4 or btrfs). FAT and exFAT filesystems
|
||||
are supported, but they don\(aqt support hard links, so each backup will be a full copy instead
|
||||
of only storing files that changed since the previous one. File ownership and permissions are
|
||||
not preserved either.
|
||||
.RE
|
||||
.TP
|
||||
.B \-e, \-\-exclude FILE|DIR|PATTERN [FILE|...]]
|
||||
Specify files, directories or patterns to exclude from the backup. Matching files and directories
|
||||
|
||||
@@ -210,7 +210,9 @@ class Backup:
|
||||
# Function to create the actual backup directory
|
||||
def define_backup_dir(self) -> None:
|
||||
"""Define the actual backup dir"""
|
||||
now = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
# Avoid ':', which is not allowed on FAT/exFAT filesystems.
|
||||
# Backups created with the old format ('%Y-%m-%d %H:%M:%S') still sort correctly
|
||||
now = datetime.now().strftime('%Y-%m-%d_%H-%M-%S')
|
||||
self._output_dir = f'{self.output}/simple_backup/{now}'
|
||||
|
||||
if self._remote:
|
||||
|
||||
Reference in New Issue
Block a user