January 12, 20251 yr I was fooling around with Chat GPT the other day and was trying to create a script that would back up certain docker data to a USB attached storage device. I am not a coder so nothing worked well. My vision is to use this for nextcloud account user data and Immich photo libraries. It would be best if there was a way to do this that only wrote the changes periodically, e.g. once per week and if it did not require disabling the apps to do the backup. Also I want it automatic, setup and forget. The purpose of this terrible backup idea is to protect against data loss in case I do something stupid and wreck the data beyond repair. And to keep it in a very portable device. Alternatively it would be nice to have a way to do this, again automatically, to a windows PC on the same LAN. Ive tried different methods with windows scripts where it grabs a file from the Unraid array at certain times but it was not very easy to use.
January 13, 20251 yr 16 hours ago, toastghost said: My vision is to use this for nextcloud account user data and Immich photo libraries. It would be best if there was a way to do this that only wrote the changes periodically, e.g. once per week and if it did not require disabling the apps to do the backup. Also I want it automatic, setup and forget. The purpose of this terrible backup idea is to protect against data loss in case I do something stupid and wreck the data beyond repair. And to keep it in a very portable device. That's already possible with rclone and a User script to execute the sync on a scheduled basis. 16 hours ago, toastghost said: Alternatively it would be nice to have a way to do this, again automatically, to a windows PC on the same LAN. Ive tried different methods with windows scripts where it grabs a file from the Unraid array at certain times but it was not very easy to use. You could use the Nextcloud Windows Desktop app to pull the data from Nextcloud to your PC to a specific folder from a certain share within Nextcloud.
January 20, 20251 yr Author I came up with this where the /mnt/user/photos_immich is my main immich directory, installed using Spaceinvader One's guide. It has a backup directory in it with a series of daily database backups. Also the rest of the pictures and whatnot are also in the directory. Immich warns against doing this when the database is active so the script turns docker off while it runs. Safety over efficiency since I do not know what I am doing. Any recommendations? I do not have a way to test restoring as I am chicken because I will be in big trouble if I accidentally botch the photo collection. #!/bin/bash # Define source and destination paths SOURCE="/mnt/user/photos_immich" DESTINATION="/mnt/cache/backups/immichbackupuo" # Define rclone log file LOGFILE="/mnt/cache/backups/rclone_backup.log" # Set rclone flags (adjust as needed) RCLONE_FLAGS="--progress --checksum --log-file=$LOGFILE" # Function to manage Docker state control_docker() { local action=$1 if [ "$action" == "stop" ]; then echo "Stopping Docker service: $(date)" | tee -a "$LOGFILE" /etc/rc.d/rc.docker stop elif [ "$action" == "start" ]; then echo "Starting Docker service: $(date)" | tee -a "$LOGFILE" /etc/rc.d/rc.docker start fi } # Stop Docker before backup control_docker stop # Start the backup process echo "Starting rclone backup: $(date)" | tee -a "$LOGFILE" rclone sync "$SOURCE" "$DESTINATION" $RCLONE_FLAGS # Check the exit status of the rclone command if [ $? -eq 0 ]; then echo "Backup completed successfully: $(date)" | tee -a "$LOGFILE" else echo "Backup encountered errors: $(date)" | tee -a "$LOGFILE" fi # Start Docker after backup control_docker start # Optional: Notify Unraid of completion /usr/local/emhttp/webGui/scripts/notify -i normal -s "Backup Completed" -d "Rclone backup task completed. Check logs for details."
January 20, 20251 yr Author Do you mean add the script to the plugin or add the directory to it? Edited January 20, 20251 yr by toastghost
January 20, 20251 yr I mean that the whole purpose of the plugin is to do that kind of thing, so likely you can just use it to do what you want by configuring it appropriately.
January 27, 20251 yr Author I appreciate the input on this idea I had. Kilrah had the best answer, and the solution to this. It is painfully easy to add any directory to the Appdata Backup plugin. Any needs I have for moving this file somewhere else can be figured out on external systems or by a much more simple script to do so.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.