April 13, 201511 yr 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!
April 13, 201511 yr What error is it throwing? Also try specifying the full path to cp: "/usr/bin/cp"
April 13, 201511 yr If its before the emhttp line then its definitely not mounted. Your best bet is to actually run it as an event when the disks are mounted. See here: http://lime-technology.com/forum/index.php?topic=26201.msg228957.msg#228957
April 13, 201511 yr 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).
April 13, 201511 yr 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
April 13, 201511 yr 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
April 13, 201511 yr 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.