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.

Quick Go Script Question

Featured Replies

I'm trying to execute a simple copy command in my go script to copy an sabnzbd skin into the right location. Anyone know why this wouldn't work?

 

cp /mnt/cache/applications/sabnzbd/skinsholding/Knockstrap /usr/local/sabnzbd/interfaces/ -r

 

I can literally copy and paste that text into the terminal from the go script and the copy works fine. Is the cache not mounted yet when the script runs?

 

Thanks!

What error is it throwing?

 

Also try specifying the full path to cp: "/usr/bin/cp"

I'm trying to execute a simple copy command in my go script to copy an sabnzbd skin into the right location. Anyone know why this wouldn't work?

 

cp /mnt/cache/applications/sabnzbd/skinsholding/Knockstrap /usr/local/sabnzbd/interfaces/ -r

 

I can literally copy and paste that text into the terminal from the go script and the copy works fine. Is the cache not mounted yet when the script runs?

 

Thanks!

It is highly likely that the cache disk is not mounted at that stage as the default contents of the go script start the emhttp process (which controls bringing the array online) but does not wait for the array to be initialised.

 

You either need to put the file somewhere other than /mnt/cache (e,g, the USB drive at /boot or add some logic to the go file to wait for the array to come up (which can take some time).

Put this before the line and it will wait for the cache to come online.

 

# determine if cache drive online, retry up to 20 times, waits up to 5 minutes.

for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

do

    if [ ! -d /mnt/cache ]

    then

      sleep 15

    fi

done

 

I'm trying to execute a simple copy command in my go script to copy an sabnzbd skin into the right location. Anyone know why this wouldn't work?

 

cp /mnt/cache/applications/sabnzbd/skinsholding/Knockstrap /usr/local/sabnzbd/interfaces/ -r

 

I can literally copy and paste that text into the terminal from the go script and the copy works fine. Is the cache not mounted yet when the script runs?

 

Thanks!

it might be because the correct way to supply the "recursive" argument (or any argument for that matter) is

cp -r source destination

options to the copy command must come before the source and destination directories/file-names

  • Author

Thanks for the replies. I decided the simplest solution was to move the files to the usb drive so they are available to be copied. It's working now.

Archived

This topic is now archived and is closed to further replies.

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.