January 4, 20251 yr Hello, would have posted this in the plugin support forum but somehow could not start a topic there. I have this problem: I installed the User.Scripts plugin and created a new script in the GUI called "backup_mariadb" which created a script file in /boot/config/plugins/user.scripts/scripts/backup_mariadb the script has the following content: #!/bin/bash echo starting the backup container=mariadb user=root password=password dbname=mydatabase backup=/mnt/user/data/backups/mariadb d=`date +%Y-%m-%d` echo deleting old backups, older than 14 days docker exec $container find $backup -type f -mtime +14 -exec rm -r {} + echo about to backup $dbname echo docker exec $container mysqldump -u $user -p$password --databases $dbname --single-transaction --quick --result-file=$backup/$dbname-$d.sql echo echo finished backup up to $backup Whenever I run the script though I get the following: Script location: /tmp/user.scripts/tmpScripts/backup_mariadb/script Note that closing this window will abort the execution of this script starting the mariadb backup deleting old backups, older than 14 days find: ‘/mnt/user/data/backups/mariadb’: No such file or directory about to backup.... The location does exist though and has permissions for nobody:user recursively. When I manually execute a find command in the terminal to look for that location it returns it like normal. Am I doing something wrong? OR what exactly could this be? Permissions? Appreciate your help. Edited January 4, 20251 yr by Antergosgeek Markdown Code blocks were not working
January 4, 20251 yr Community Expert Solution When you use docker exec you are referring to a path within the container, but ‘find’ in the Unraid terminal uses a path at the Unraid level and it is unlikely these are the same.
January 4, 20251 yr Author Totally makes sense now. I completely overlooked that. So I need to find a location outside of the mariadb container, bind it to the container and change the accordingly. Thank you!
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.