Nimdy / Dedicated_Valheim_Server_Script

Valheim Server Manager . Supports: ValheimPlus, Bepinex, Multi-world, Multi-Lang, Update, Backup, Restore and more: Built for Linux
GNU Affero General Public License v3.0
697 stars 120 forks source link

Issue with Backup feature in menu.sh #62

Closed ghost closed 3 years ago

ghost commented 3 years ago

Issue with Backup feature in menu.sh The issue: The creating of the .tgz file isn't being done correctly.

Output of backup server command:

Checking to see if backup directory is created
If not, one will be created
Cleaning up old backup files. Older than 2 weeks
Cleaned up better than Loki
Stopping Valheim Server for clean backups
Stopped
Making tar file of world data
tar: AM.tgz: Cannot stat: No such file or directory
tar: Removing leading `/' from member names
tar: Removing leading `/' from hard link targets
tar: Exiting with failure status due to previous errors
Process complete!
Restarting the best Valheim Server in the world
Valheim Server Service Started

Setting permissions for steam on backup file
Process complete!

Probably because of the $date thingy, it's either giving me an error like:

tar: AM.tgz: Cannot stat: No such file or directory

or

tar: PM.tgz: Cannot stat: No such file or directory

The /home/steam/backup is consisting of files with no extensions, like so:

drwxr-xr-x 2 steam steam 4.0K Feb 24 00:03 .
drwxr-xr-x 6 steam steam 4.0K Feb 22 12:55 ..
-rw-r--r-- 1 steam steam  224 Feb 21 13:45 valheim-backup-2021-02-21-01:45:37
-rw-r--r-- 1 steam steam 8.9M Feb 22 09:33 valheim-backup-2021-02-22-09:33:08
-rw-r--r-- 1 steam steam 8.9M Feb 22 09:33 valheim-backup-2021-02-22-09:33:23
-rw-r--r-- 1 steam steam 8.9M Feb 22 09:34 valheim-backup-2021-02-22-09:34:32
-rw-rw-r-- 1 steam steam 8.9M Feb 22 12:46 valheim-backup-2021-02-22-12:46:53
-rw-r--r-- 1 steam steam  13M Feb 23 16:22 valheim-backup-2021-02-23-04:22:36
-rw-r--r-- 1 steam steam  12M Feb 23 00:34 valheim-backup-2021-02-23-12:34:38
-rw-r--r-- 1 steam steam  13M Feb 24 00:03 valheim-backup-2021-02-24-12:02:55

Reproducing: 1) Have a 12-hour AM/PM based locale, e.g. LC_TIME=en_US.UTF-8 2) Open "menu.sh" as sudo 3) Choose Server Admin Tools 4) Choose Backup World 5) Gives an error like the one described above 6) Backup files have no extension(s), like the expected .tgz

Other info: OS: Ubuntu 20.04.2 LTS Running: date shows: Wed 24 Feb 2021 12:17:44 AM CET date +%Y-%m-%d-%X shows: 2021-02-24-12:19:05 AM

ghost commented 3 years ago

Okay, so I fixed it. Obviously the error lies in 12-hour based systems. Changed my locale to a 24-hour based one: localectl set-locale LC_TIME=en_GB.UTF-8

Nimdy commented 3 years ago

was sure if I should force... time systems...

Thank you for the info...