mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-20 05:58:27 +00:00
add --allmaps and --autobackups to backup command
This commit is contained in:
parent
c116e12b2a
commit
0b59dfd67d
@ -2839,6 +2839,17 @@ doBackup(){
|
|||||||
mkdir -p "$backupdir"
|
mkdir -p "$backupdir"
|
||||||
mkdir -p "$backupdirdaily"
|
mkdir -p "$backupdirdaily"
|
||||||
|
|
||||||
|
for arg in "$@"; do
|
||||||
|
case "$arg" in
|
||||||
|
--allmaps) backupAllMaps=true; ;;
|
||||||
|
--autobackups) includeAutoBackups=true; ;;
|
||||||
|
*)
|
||||||
|
echo "Unrecognized option $arg"
|
||||||
|
echo "Try 'arkmanager -h' or 'arkmanager --help' for more information."
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
if [[ -z "$savedir" ]]; then
|
if [[ -z "$savedir" ]]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@ -2880,7 +2891,8 @@ doBackup(){
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy other world files
|
# Copy other world files
|
||||||
if [ -n "$backupAllMaps" ]; then
|
if [ "$backupAllMaps" == "true" ]; then
|
||||||
|
echo -e "${NORMAL} Copying other ARK world files"
|
||||||
for f in "${savedir}/"*.ark; do
|
for f in "${savedir}/"*.ark; do
|
||||||
if [[ "${f}" != "${mapfile}" && "${f}" != "${savedir}/"*_??.??.????_??.??.??.ark ]]; then
|
if [[ "${f}" != "${mapfile}" && "${f}" != "${savedir}/"*_??.??.????_??.??.??.ark ]]; then
|
||||||
cp -p "${f}" "${backupdir}/${f##*/}"
|
cp -p "${f}" "${backupdir}/${f##*/}"
|
||||||
@ -2888,6 +2900,16 @@ doBackup(){
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Copy map autobackups
|
||||||
|
if [ "$includeAutoBackups" == "true" ]; then
|
||||||
|
echo -e "${NORMAL} Copying all ARK world autobackup files"
|
||||||
|
for f in "${savedir}/"*.ark; do
|
||||||
|
if [[ "${f}" == "${savedir}/"*_??.??.????_??.??.??.ark ]]; then
|
||||||
|
cp -p "${f}" "${backupdir}/${f##*/}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# ARK server uses Lock-Truncate-Write-Unlock
|
# ARK server uses Lock-Truncate-Write-Unlock
|
||||||
# Unfortunately we can't lock the file, as
|
# Unfortunately we can't lock the file, as
|
||||||
# ARK server uses a non-blocking lock and will
|
# ARK server uses a non-blocking lock and will
|
||||||
@ -3737,7 +3759,7 @@ main(){
|
|||||||
listMods
|
listMods
|
||||||
;;
|
;;
|
||||||
backup)
|
backup)
|
||||||
doBackup
|
doBackup "${options[@]}"
|
||||||
;;
|
;;
|
||||||
broadcast)
|
broadcast)
|
||||||
doBroadcast "${args[@]}"
|
doBroadcast "${args[@]}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user