• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support General Questions best way to backup (lsio) docker jellyfin data?

     
    • 0 Vote(s) - 0 Average

    best way to backup (lsio) docker jellyfin data?

    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #4
    2024-04-23, 01:42 AM
    I had some hardware failure last summer and was able to restore from the backup made with this script.  No corruption.

    Code:
    #!/bin/bash

    BACKUP_LIST=/root/backup_list.txt

    while read list ; do
    source=$(echo $list | awk -F ':' '{print $1}')
    dest=$(echo $list | awk -F ':' '{print $2}')
    rsync -a -r -p --progress --exclude /var/lib/docker "$source" "$dest" --delete >> /root/backup.log
    done < $BACKUP_LIST

    It reads in a text file that has a source directory to backup and a destination of where to place the backup.  If you delete or change a file in the source directory it will delete it from the backup directory (the --delete option).

    Excluding /var/lib/docker is important because it only contains temporary data and takes up a lot of space if you don't exclude it.

    An example of the text file specifying what to backup.  The colon separates the source (left) with the destination (right)

    Code:
    /home:/media/extended/Backups/
    /etc:/media/extended/Backups/
    /var:/media/extended/Backups/
    /media/storage:/media/extended/Backups/media/
    /media/storage/Pictures:/media/extended/Backups/
    /docker:/media/extended/Backups/

    In /etc/cron.d I created a text file that contains the cronjob schedule.  You can also put this in root's crontab.

    Code:
    0 3 * * * root /root/backup.sh
    0 1 * * mon root cat /dev/null > /root/backup.log

    This runs the backup script nightly at 3am.  Every Monday at 1am it nulls the backup log file.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    Messages In This Thread
    best way to backup (lsio) docker jellyfin data? - by Iacov - 2024-04-22, 06:22 PM
    RE: best way to backup (lsio) docker jellyfin data? - by TheDreadPirate - 2024-04-22, 06:35 PM
    RE: best way to backup (lsio) docker jellyfin data? - by Iacov - 2024-04-22, 07:14 PM
    RE: best way to backup (lsio) docker jellyfin data? - by TheDreadPirate - 2024-04-23, 01:42 AM
    RE: best way to backup (lsio) docker jellyfin data? - by Iacov - 2024-04-26, 11:10 AM
    RE: best way to backup (lsio) docker jellyfin data? - by Iacov - 2024-04-30, 01:45 PM
    RE: best way to backup (lsio) docker jellyfin data? - by bitmap - 2024-04-30, 02:43 PM
    RE: best way to backup (lsio) docker jellyfin data? - by TheDreadPirate - 2024-04-30, 01:49 PM

    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode