GameServerManagers / GameServerManagers/LinuxGSM
pass a name for the backup archive
- Dominant language
- Shell
- Stars
- 4.9k
- Forks
- 864
- PR merge metrics
- No merged PRs in 30d
Description
When creating an archive, can it be added the ability to pass a name for that archive, rather than using `backupname="${servicename}-$(date '+%Y-%m-%d-%H%M%S')"` ?
I've tried something like this, in command_backup.sh:
```
# Initialisation.
fn_backup_init(){
# Backup file name with servicename and current date.
if [ -z $1 ]; then
backupname="${servicename}-$(date '+%Y-%m-%d-%H%M%S')"
else
backupname=$1
fi
info_distro.sh
fn_print_dots "Backup starting"
fn_script_log_info "Backup starting"
fn_print_ok_nl "Backup starting"
if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
fn_print_info_nl "There are no previous backups"
else
if [ "${lastbackupdaysago}" == "0" ]; then
daysago="less than 1 day ago"
elif [ "${lastbackupdaysago}" == "1" ]; then
daysago="1 day ago"
else
daysago="${lastbackupdaysago} days ago"
fi
echo " * Previous backup was created ${daysago}, total size ${lastbackupsize}"
fi
}
...
# Run functions.
fn_backup_check_lockfile
fn_backup_create_lockfile
fn_backup_init $1
fn_backup_stop_server
fn_backup_dir
fn_backup_compression
fn_backup_prune
fn_backup_start_server
core_exit.sh
```
But other arguments are getting passed.
Contributor guide
Assessment
This issue has not been assessed yet.