mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-23 23:18:28 +00:00
Fix a couple of backup issues
This commit is contained in:
parent
36249c56ce
commit
2f1d3cabe5
@ -2193,63 +2193,69 @@ doBackup(){
|
|||||||
# fail to update the file if the lock fails.
|
# fail to update the file if the lock fails.
|
||||||
echo -e "${NORMAL} Copying ARK profile files"
|
echo -e "${NORMAL} Copying ARK profile files"
|
||||||
for f in "${savedir}/"*.arkprofile; do
|
for f in "${savedir}/"*.arkprofile; do
|
||||||
echo -ne "${NORMAL} ${f##*/} "
|
if [ -f "${f}" ]; then
|
||||||
cp -p "${f}" "${backupdir}/${f##*/}"
|
echo -ne "${NORMAL} ${f##*/} "
|
||||||
if [ ! -s "${backupdir}/${f##*/}" ]; then
|
|
||||||
sleep 2
|
|
||||||
cp -p "${f}" "${backupdir}/${f##*/}"
|
cp -p "${f}" "${backupdir}/${f##*/}"
|
||||||
fi
|
if [ ! -s "${backupdir}/${f##*/}" ]; then
|
||||||
# If both attempts fail, server may have
|
sleep 2
|
||||||
# crashed between truncate and write
|
cp -p "${f}" "${backupdir}/${f##*/}"
|
||||||
if [ ! -s "${backupdir}/${f##*/}" ]; then
|
fi
|
||||||
cp -p "${f%.arkprofile}.tmpprofile" "${backupdir}/${f##*/}"
|
# If both attempts fail, server may have
|
||||||
fi
|
# crashed between truncate and write
|
||||||
if [ -s "${backupdir}/${f##*/}" ]; then
|
if [[ ! -s "${backupdir}/${f##*/}" && -f "${f%.arkprofile}.tmpprofile" ]]; then
|
||||||
echo -e "${NORMAL}\e[68G[ ${GREEN}OK${NORMAL} ]"
|
cp -p "${f%.arkprofile}.tmpprofile" "${backupdir}/${f##*/}"
|
||||||
else
|
fi
|
||||||
echo -e "${NORMAL}\e[68G[ ${RED}FAILED${NORMAL} ]"
|
if [ -s "${backupdir}/${f##*/}" ]; then
|
||||||
|
echo -e "${NORMAL}\e[68G[ ${GREEN}OK${NORMAL} ]"
|
||||||
|
else
|
||||||
|
echo -e "${NORMAL}\e[68G[ ${RED}FAILED${NORMAL} ]"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# ARK server uses Lock-Truncate-Write-Unlock
|
# ARK server uses Lock-Truncate-Write-Unlock
|
||||||
echo -e "${NORMAL} Copying ARK tribe files "
|
echo -e "${NORMAL} Copying ARK tribe files "
|
||||||
for f in "${savedir}/"*.arktribe; do
|
for f in "${savedir}/"*.arktribe; do
|
||||||
echo -ne "${NORMAL} ${f##*/} "
|
if [ -f "${f}" ]; then
|
||||||
cp -p "${f}" "${backupdir}/${f##*/}"
|
echo -ne "${NORMAL} ${f##*/} "
|
||||||
if [ ! -s "${backupdir}/${f##*/}" ]; then
|
|
||||||
sleep 2
|
|
||||||
cp -p "${f}" "${backupdir}/${f##*/}"
|
cp -p "${f}" "${backupdir}/${f##*/}"
|
||||||
fi
|
if [ ! -s "${backupdir}/${f##*/}" ]; then
|
||||||
# If both attempts fail, server may have
|
sleep 2
|
||||||
# crashed between truncate and write
|
cp -p "${f}" "${backupdir}/${f##*/}"
|
||||||
if [ ! -s "${backupdir}/${f##*/}" ]; then
|
fi
|
||||||
cp -p "${f%.arktribe}.tmptribe" "${backupdir}/${f##*/}"
|
# If both attempts fail, server may have
|
||||||
fi
|
# crashed between truncate and write
|
||||||
if [ -s "${backupdir}/${f##*/}" ]; then
|
if [[ ! -s "${backupdir}/${f##*/}" && -f "${f%.arktribe}.tmptribe" ]]; then
|
||||||
echo -e "${NORMAL}\e[68G[ ${GREEN}OK${NORMAL} ]"
|
cp -p "${f%.arktribe}.tmptribe" "${backupdir}/${f##*/}"
|
||||||
else
|
fi
|
||||||
echo -e "${NORMAL}\e[68G[ ${RED}FAILED${NORMAL} ]"
|
if [ -s "${backupdir}/${f##*/}" ]; then
|
||||||
|
echo -e "${NORMAL}\e[68G[ ${GREEN}OK${NORMAL} ]"
|
||||||
|
else
|
||||||
|
echo -e "${NORMAL}\e[68G[ ${RED}FAILED${NORMAL} ]"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# ARK server uses Lock-Truncate-Write-Unlock
|
# ARK server uses Lock-Truncate-Write-Unlock
|
||||||
echo -e "${NORMAL} Copying ARK tribute tribe files "
|
echo -e "${NORMAL} Copying ARK tribute tribe files "
|
||||||
for f in "${arkserverroot}/ShooterGame/Saved/${savedir}/"*.arktributetribe; do
|
for f in "${savedir}/"*.arktributetribe; do
|
||||||
echo -ne "${NORMAL} ${f##*/} "
|
if [ -f "${f}" ]; then
|
||||||
cp -p "${f}" "${backupdir}/${f##*/}"
|
echo -ne "${NORMAL} ${f##*/} "
|
||||||
if [ ! -s "${backupdir}/${f##*/}" ]; then
|
|
||||||
sleep 2
|
|
||||||
cp -p "${f}" "${backupdir}/${f##*/}"
|
cp -p "${f}" "${backupdir}/${f##*/}"
|
||||||
fi
|
if [ ! -s "${backupdir}/${f##*/}" ]; then
|
||||||
# If both attempts fail, server may have
|
sleep 2
|
||||||
# crashed between truncate and write
|
cp -p "${f}" "${backupdir}/${f##*/}"
|
||||||
if [ ! -s "${backupdir}/${f##*/}" ]; then
|
fi
|
||||||
cp -p "${f%.arktribe}.tmptributetribe" "${backupdir}/${f##*/}"
|
# If both attempts fail, server may have
|
||||||
fi
|
# crashed between truncate and write
|
||||||
if [ -s "${backupdir}/${f##*/}" ]; then
|
if [[ ! -s "${backupdir}/${f##*/}" && -f "${f%.arktributetribe}.tmptributetribe" ]]; then
|
||||||
echo -e "${NORMAL}\e[68G[ ${GREEN}OK${NORMAL} ]"
|
cp -p "${f%.arktributetribe}.tmptributetribe" "${backupdir}/${f##*/}"
|
||||||
else
|
fi
|
||||||
echo -e "${NORMAL}\e[68G[ ${RED}FAILED${NORMAL} ]"
|
if [ -s "${backupdir}/${f##*/}" ]; then
|
||||||
|
echo -e "${NORMAL}\e[68G[ ${GREEN}OK${NORMAL} ]"
|
||||||
|
else
|
||||||
|
echo -e "${NORMAL}\e[68G[ ${RED}FAILED${NORMAL} ]"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user