Jump to content

Linux bash script - ark auto recovery, backup and archive script


Jamie

Recommended Posts

  • Owner

Do you have a Linux ARK server that after updating mods it wipes the map ?

Do you need a reliable backup solution?

Don't delay, use JR's backup solution today!

STOP, BEFORE YOU CONTINUE TO READ ENSURE YOU KNOW IF YOU HAVE A DEDICATED / VPS SERVER. IF YOU DO NOT KNOW WHAT THESE MEAN / ARE THEN TURN AWAY AND DONT ATTEMPT INSTALL.

No but seriously... ARK can be crap in the way it updates mods which can cause at times map wipes. This has gotten to the stage where I'm so pissed off I was very close to close down all ARK servers and say fuck this. ARK at random times on linux decides to randomly wipe the map without any trace / logs of the issue. 

I have found it seems to be any time a mod update goes through. 7x's out of 10 this can cause a wipe and there is no fix...

Apart from the recovery script I have just created which we are currently using on JR to ensure things are backed up. I'm publishing this so other ARK server owners can have a reliable backup / archive and recovery method.

I have tested this on a production environment and all is working smoothly, your experience may differ. PLEASE ENSURE YOU TEST!

 

This script does the following:

  • Creates backups of maps (dependent on cron job time of recovery.sh script)
  • Auto deletion of backups after reaching certain amount 
  • Creates a separate archive of maps (use the dailycleanarchive.sh script as a daily cron job to ensure this archive doesn't get too big)
  • Recovers to the latest backup if the script detects that your servers map file has dropped below the filesize of your latest backup - the tolerance.
  • Uses a tolerance variable to ensure that a backup doesn't auto recover if the map file gets smaller due to culling of dinos / removal of structures.
  • Kills your server to reinstall the map.

To install:

  • Ensure you are using a linux host and that you have full root access
  • Download the rar  file in this post, extract it to a folder on your server.
  • Ensure you chmod +x both files. for example chmod +x recovery.sh
  • Edit the following variables to match your server:
#ARK Recovery DIR
    arkrecover="/srv/daemon-data/ARKRecovery"
    #SERVER REF - USED FOR SVR DIR (NAME OF SERVER FOLDER GENERALLY)
    svrref="da4aaa1b-0ce9-46d2-bd60-5f599cc089ae"
    #SERVER MAP DIRECTORY
    svrdir="/srv/daemon-data/$svrref/ShooterGame/Saved/SavedArks"
    #Map filename for backup
    file="Valguero_P.ark"
    #Name of backup - will auto add y/m/d and time
    backupname="Valguero"
    #Amount of File backups in days to store at one time 
    backupamount=10
    logname="da4aaa1b.txt"
    #Add fault tolerance as variance may be produced due to normal ARK saving / culling of dinos
    #THIS IS CALCULATED IN BYTES. 15024000 = Slightly more than 15 mb. IF YOU HAVE A SMALLER MAP THIS MAY NEED TO BE EDITED TO ENSURE CORRECT RECOVERY.
    #ENSURE TOLERANCE IS SET TO LESS THAN ACTUAL MAP SIZE OTHERWISE THIS COULD CAUSE A RECOVERY.
    tolerance=15024000
  • Ensure that you set the script to kill your server before map restoration, currently the script uses a docker kill command. If you don't use docker you will need to kill your server via killing the process or using a more graceful method by removing the docker kill command in the script. This is on line 83
  • Add a start line after line 88. Please note that this isn't required for my servers as if our servers get killed they will auto start pretty rapidly. If you use pterodactyl for ark, this will not need to be added.
  • Create a cron job that will run recovery.sh every 5 - 10 minutes. This ensures that the file is been checked and that it is auto backing up, if it detects the main map file has gone below the threshold (backup filesize - tolerance) the system will auto recover the map file
  • Create a cron job that will run dailycleanarchive.sh every day at a suitable time. This file ensures your archive is cleaned up every day and you also have 7 days (configurable) of backups.

 

Please note if you change the ARKRecover directory, you will also have to update the arkrecover directory in the dailycleanarchive.sh otherwise it will not auto clean.

If you do need help integrating this script please post below I have no problem to help users. But please note I will not be helping users that do not have a dedicated or VPS server running ARK, this is a script that will not work for you. 

I or JR will not be responsible in anyway for loosing ARK maps / incorrect recovery, especially due to misconfiguration. This is a script that we use at JR and it works. We can not be held responsible if it doesn't work, it is in your own interest to test the script before using on a production environment.

If this script has helped you please donate to JR / me to ensure the continued updating of this script. https://donate.jrnetwork.net

 

Latest_Recovery.rar

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Topics

  • Servers Info - (View All Servers)

    • Servers Status
    • Issues with
      3 servers not responding
    • Total Servers
      9
    • Most Online
      65
    • Players Playing
      0 / 458
      0 / 458
  • Posts

    • Recently, I've switched to Unraid. While mostly non-problematic, one problem did arise.  This problem being booting the server, if I booted it with USB selected as the boot method in the BIOS it would not boot after restarting the server or switching it off and on. I tried absolutely everything to fix the issue, power settings, updating BIOS, contacting ASUS (who told me it would need a warranty replacement) and others. The fix ? Simple! Switch off Fast Boot in the bios, when fastboot was enabled it wasn't enabling all the USB ports at BIOS boot. Once this was disabled it resolved all booting issues to USB! I hope this helps you if you come across this issue too!
    • It's a completely seperate game not an update, so in game purchases not carrying across is expected. They'll keep the servers for Warzone 1 up as long as they are making money off of it.
    • Hey All, I've been reading that if you have purchased content on Warzone it will not transfer to the newest version of warzone which will be released alongside the MWII release! Supposedly Warzone 1 will run alongside Warzone 2 as separate experiences. But this calls on a few questionable factors. How long will Warzone 1 be supported for ? I know for a fact any time a new game is released by activision the previous game falls to the abyss.  With the fact a lot of people have spent a lot of money on warzone 1 are they going to get anything by transitioning to warzone 2.  I just think it's mad that if you have bought something in Warzone recently it's not going to carry over and activision have stated: (https://www.callofduty.com/blog/2022/06/call-of-duty-modern-warfare-II-announcement-release-reveal) A bit ominous but it does state that it'll be entirely separate.   What's your view on this ? Do we need to storm activision ?!
    • Nice mate, what networking hardware are you using ? Send us a pic, I want a clean tidy setup spartan !
×
×
  • Create New...

Important Information

By continuing to use JR, you agree to our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.