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.

docker run not working with shell script

Featured Replies

Hi there,

 

i want to do my backups with restic and rsync. So i setup a shell script that starts the container and does the backup.

But the docker run commands are not running properly when called by the script. It looks like there is some issue with variables given to the computer.

if i copy&paste them to the command line everything works. maybe someone can point my in the right direction to fix that problem.

 

 

 

  • Community Expert

Not enough details. What script? How are you running it? What exactly is the result?

  • Author
docker run --rm -v $(pwd):/data -e RESTIC_REPOSITORY=s3:s3.amazonaws.com/bucket_name -e RESTIC_PASSWORD=my-secure-password 
           -e AWS_ACCESS_KEY_ID=my-aws-access-key -e AWS_SECRET_ACCESS_KEY=my-aws-secret-key instrumentisto/restic backup /data

 

thats the example call for the restic container. I just changed the needed parameters.

The script just contains these calls with different folders.

when i run the shell script this happens:

 

root@nas:/mnt/user/myscripts/resticNasBackup# ./resticBackuphtpc.sh
 does not exist, skipping
Fatal: all target directories/files do not exist
 does not exist, skipping
...

it looks like the when the script is executed the target vars are not set properly. i don't understand why.

 

if i copy and paste a single docker run call from the script to the console it is running, no issue.

root@nas:~# docker run --rm -v /mnt/user/fotos:/fotos -e RESTIC_REPOSITORY=s3:http://10.24.13.148:9000/backupnas -e RESTIC_PASSWORD= -e AWS_ACCESS_KEY_ID= -e AWS_SECRET_ACCESS_KEY= instrumentisto/restic --verbose backup /fotos
open repository
created new cache in /root/.cache/restic
lock repository
load index files
start scan on [/fotos]
start backup on [/fotos]

 

Edited by datun1c0rn

  • Author

somehow i can't run any shellscript as the root user via console.

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.