mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
Implement --suffix for use with --backup-dir only #98
This also makes sure we remove files we are about to override in the --backup-dir properly.
This commit is contained in:
@@ -87,6 +87,7 @@ var (
|
||||
noTraverse = BoolP("no-traverse", "", false, "Don't traverse destination file system on copy.")
|
||||
noUpdateModTime = BoolP("no-update-modtime", "", false, "Don't update destination mod-time if files identical.")
|
||||
backupDir = StringP("backup-dir", "", "", "Make backups into hierarchy based in DIR.")
|
||||
suffix = StringP("suffix", "", "", "Suffix for use with --backup-dir.")
|
||||
bwLimit BwTimetable
|
||||
|
||||
// Key to use for password en/decryption.
|
||||
@@ -211,6 +212,7 @@ type ConfigInfo struct {
|
||||
NoUpdateModTime bool
|
||||
DataRateUnit string
|
||||
BackupDir string
|
||||
Suffix string
|
||||
}
|
||||
|
||||
// Find the config directory
|
||||
@@ -263,6 +265,7 @@ func LoadConfig() {
|
||||
Config.NoTraverse = *noTraverse
|
||||
Config.NoUpdateModTime = *noUpdateModTime
|
||||
Config.BackupDir = *backupDir
|
||||
Config.Suffix = *suffix
|
||||
|
||||
ConfigPath = *configFile
|
||||
|
||||
@@ -286,6 +289,10 @@ func LoadConfig() {
|
||||
log.Fatalf(`Can't use --size-only and --ignore-size together.`)
|
||||
}
|
||||
|
||||
if Config.Suffix != "" && Config.BackupDir == "" {
|
||||
log.Fatalf(`Can only use --suffix with --backup-dir.`)
|
||||
}
|
||||
|
||||
// Load configuration file.
|
||||
var err error
|
||||
configData, err = loadConfigFile()
|
||||
|
||||
Reference in New Issue
Block a user