Additional directories and backup location in the config file not working.
AshdoII opened this issue ยท 11 comments
The save location seems to work normally now. May I ask how should I configure the "additional directories" and "additional files" to backup all the files in the root folder?
@AshdoII I found the problem. Kinda.
If you do this: [./], the Mod thinks you want to start a comment and throws an error:
Expected start of comment but got ']'
It's an array of strings in JSON5
So
["./"], will caution you against this, as you'll backup your previous backups, and all sorts, I suggest you specify the things you actually need to backup.
@ThePaul-T I have the backup folder somwhere else.
And problem is, it still only backups the world folder.
Additionally it doesn't even finish the backup because of this error:
[net.creeperhost.ftbbackups.FTBBackups/]: Failed to create backup
java.util.zip.ZipException: duplicate entry: world/poi/r.19.7.mca
at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:259) ~[?:?]
at net.creeperhost.ftbbackups.utils.FileUtils.packIntoZip(FileUtils.java:88) ~[ftbbackups2-forge-1.20-1.0.23.jar%23398!/:?]
at net.creeperhost.ftbbackups.utils.FileUtils.zip(FileUtils.java:71) ~[ftbbackups2-forge-1.20-1.0.23.jar%23398!/:?]
at net.creeperhost.ftbbackups.BackupHandler.lambda$createBackup$1(BackupHandler.java:308) ~[ftbbackups2-forge-1.20-1.0.23.jar%23398!/:?]
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.lang.Thread.run(Thread.java:1583) ~[?:?]
I am now get this error with my config:
{
// Allow the creation of backups automatically
"enabled": true,
// Permission level to use the /backup command
"command_permission_level": 3,
// Only send backup status to server ops
"notify_op_only": false,
// Don't send backup status at all
"do_not_notify": false,
/* Backup retention mode. Valid Modes: MAX_BACKUPS, TIERED
Note: TIERED mode is an experimental feature, Use at your own risk.
*/
"retention_mode": "MAX_BACKUPS",
// Applies to retention_mode:MAX_BACKUPS, Sets the maximum number of backups to keep
"max_backups": 25,
// Applies to retention_mode:TIERED, The latest x number of backups will be retained
"keep_latest": 5,
// Applies to retention_mode:TIERED, Sets number of hourly backups to keep
"keep_hourly": 1,
// Applies to retention_mode:TIERED, Sets number of daily backups to keep
"keep_daily": 1,
// Applies to retention_mode:TIERED, Sets number of weekly backups to keep
"keep_weekly": 1,
// Applies to retention_mode:TIERED, Sets number of monthly backups to keep
"keep_monthly": 1,
/* This is done with an implementation of cron from the Quartz java library.
More info here
(http://www.cronmaker.com)
*/
"backup_cron": "0 0/30 * 1/1 * ? *",
// Time between manual backups using the command
"manual_backups_time": 0,
// Only run a backup if a player has been online since the last backup
"only_if_players_been_online": true,
// Additional directories to include in backup
"additional_directories": [
"/home/antony/Schreibtisch/Memoria2/"
],
/* Additional files and directories to include in backup.
Can specify a file name, path relative to server directory or wildcard file path
Examples: (All file paths are relative to server root)
fileName.txt Any/all file named "fileName.txt"
folder/file.txt Exact file path
folder/ Everything in this folder
path/starts/with* Any files who's path starts with
*path/ends/with.txt Any files who's path ends with
*path/contains* Any files who's path contains
*/
"additional_files": [],
// Display file size in backup message
"display_file_size": true,
// backup location
"backup_location": "/home/antony/Server-Backups/Memoria2/",
// Specify the backup format. Valid options are ZIP and DIRECTORY
"backup_format": "ZIP",
// Minimum free disk space in MB. If a backup's creation would leave less than this amount of disk space remaining, the backup will be aborted.
"minimum_free_space": 25000,
// If the previous backup failed due to lack of space, the oldest backup will be deleted to free space.
"free_space_if_needed": true,
/* Specify files or folders to be excluded.
Can specify a file name, path relative to server directory or wildcard file path
Examples: (All file paths are relative to server root)
fileName.txt Any/all file named "fileName.txt"
folder/file.txt Exact file path
folder/ Everything in this folder
path/starts/with* Any files who's path starts with
*path/ends/with.txt Any files who's path ends with
*path/contains* Any files who's path contains
*/
"excluded": [],
// The dimension used when creating backup preview image, specify "all" to enable automatic detection of primary dimension (can be very slow)
"preview_dimension": "all"
}
Regarding the "Duplicate entry" exception,
You have the following specified in additional directories: /home/antony/Schreibtisch/Memoria2/
If Memoria2 is the server, directory then that includes the world folder, which is already being backed up,
resulting in duplicate files.
As for the Jason exception, I can not explain that. That error suggest that your json is invalid, but the one you posted appears to be perfectly fine.
The next update will include a fix for the duplicate entry error when specifying the server directory as an additional directory.
As for the Jason exception, I can not explain that. That error suggest that your json is invalid, but the one you posted appears to be perfectly fine.
Is is possibly caused by the Comments? Because Visual Studio Code tells me that Comments aren't allowed in Json Files