Jump to content
  • Posts

    5
  • Joined

  • Last visited

Posts posted by [email protected]

  1. 27 minutes ago, ich777 said:

    One recommendation would be to add a line where you it only keeps the last 10 backups and if a new one is found that the oldest one is deleted. :)

    There are many ways with ls -alt or find... :)

    I'm not sure how long my gaming group is going to be on the Valheim kick, and at 16mb/day, I'm not overly concerned with storage. BUT you're right; it's good practice. I've edited the script to include a clean up action. Thanks!

    • Like 1
  2. On 2/9/2021 at 2:21 PM, luckyy said:

    Just thought I'd share my experience setting up a Valheim server with this docker app from @ich777(thank you!)

     

     

    And thanks for the instructions. I've been running this docker with Valheim since Feb 4th, and it's been very stable. Here is my user script to backup World files; I have mine set to run at 03:30 daily. Note that your destination paths will be different, so make sure you update it to match your setup.

    #!/bin/bash
    
    # Create a compressed file archive as a backup for the Valheim server
    
    today=$(date '+%m_%d_%Y__%H_%M_%S')
    backup_path=/mnt/user/CA-backups/valheim_backup
    source_path=/mnt/user/appdata/valheim/.config/.
    backup_file=$backup_path/valheim_$today.7z
    
    7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=off $backup_file $source_path
    # Keep only the 10 newest backups
    ls -t $backup_path/*.7z | awk 'NR>10' | xargs --no-run-if-empty rm -f

     

×
×
  • Create New...