Skip to content

[BUG] Backup command fails due to bad backup.lock handling #3211

@StinkyMcKraken

Description

@StinkyMcKraken

User Story

I have discovered the LinuxGSM Backup command is not working. I run Backups once a week via crontab, my last backup was 22 days ago as of this post, on 1/11/21. Found the commit that broke it, 8 days ago, a194f3c

Basic info

  • Distro: Ubuntu 20.04.2 LTS
  • Game: ARK: Survival Evolved
  • Command: Backup
  • LinuxGSM version: v21.1.1

Further Information

LGSM is creating backup.lock then checking to see if a backup is running. When the backup check finds the newly created backup.lock, it [INFO]s saying a backup is running and quits.

I have manually deleted backup.lock multiple times and manually run backup. Here is the output:

ark@arkpython:~$ ./arkserver backup
[  OK  ] Backing up arkserver: Backup starting
* Previous backup was created 22 days ago, total size 6.3G
[ INFO ] Backing up arkserver: Lock file found: Backup is currently running

Additional info:
I looked at command_backup.sh on github.
fn_backup_check_lockfile happens well after fn_backup_create_lockfile
command_backup.sh lines 256-265 are as follows:

# Run functions.
fn_backup_create_lockfile  <<
fn_backup_init
fn_backup_stop_server
fn_backup_dir
fn_backup_migrate_olddir
fn_backup_check_lockfile  <<
fn_backup_compression
fn_backup_prune
fn_backup_start_server

To Reproduce

Run LGSM Backup command on any LGSM install, it is not specific to any game server

Expected behaviour

  1. check for running backup (existence of backup.lock)
  2. if found backup.lock, exit with error message
  3. if not found, create backup.lock
  4. proceed with backup
  5. remove lockfile

maybe reorder the run functions:

# Run functions.
fn_backup_init
fn_backup_stop_server
fn_backup_dir
fn_backup_migrate_olddir
fn_backup_check_lockfile  #<<
fn_backup_create_lockfile  #<<
fn_backup_compression
fn_backup_prune
fn_backup_start_server

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions