Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

User.Scripts Plugin Support needed - Script not finding directory

Featured Replies

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 by Antergosgeek
Markdown Code blocks were not working

Solved by itimpi

  • 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.

  • 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.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.