March 11, 20215 yr 2 hours ago, ICDeadPpl said: Put 'bash' in front of the command. Like 'bash /boot/config/plugins/user.scripts/scripts/backup_onedrive/script' Thanks ICDeadPpl, that worked. I've in one main script multiple sub user scripts I would like to launch. Is it possible to wait for one command to finish before launching the next? Currently both are started at the same time because of the "at now" command. I there a method to launch the second after the first is finished. Thanks for the help
March 11, 20215 yr 25 minutes ago, tschinz said: Thanks ICDeadPpl, that worked. I've in one main script multiple sub user scripts I would like to launch. Is it possible to wait for one command to finish before launching the next? Currently both are started at the same time because of the "at now" command. I there a method to launch the second after the first is finished. Thanks for the help just do everything in one script, dont think there is a easy way. you could save a text file in the sub-scripts and wait for the file to appear in the main script
March 11, 20215 yr 3 hours ago, Marcel40625 said: Hey there, i would like to know how i can mail the whole output of rsync -av --delete --ignore-errors -e as notification thanks in advance You could call '/usr/local/emhttp/webGui/scripts/notify' from your script, and have the message include the output of the rsync job. The rsync output could be temporarily stored as a file, piped argument, named pipe or whatever. Run the command '/usr/local/emhttp/webGui/scripts/notify' once without any arguments to see which there are for you to use. You may want to check the notifications in Unradid Web UI "Settings/Notifications settings" so they are set to send email.
March 11, 20215 yr 3 hours ago, Marcel40625 said: Hey there, i would like to know how i can mail the whole output of rsync -av --delete --ignore-errors -e as notification thanks in advance with the at command you can get an email command | at now
March 11, 20215 yr 10 minutes ago, ICDeadPpl said: You could call '/usr/local/emhttp/webGui/scripts/notify' from your script, and have the message include the output of the rsync job. The rsync output could be temporarily stored as a file, piped argument, named pipe or whatever. Run the command '/usr/local/emhttp/webGui/scripts/notify' once without any arguments to see which there are for you to use. You may want to check the notifications in Unradid Web UI "Settings/Notifications settings" so they are set to send email. yeah but how can i attach the file or output from rsync to the notify command /usr/local/emhttp/webGui/scripts/notify -i normal -s "Test" -d "Test" -m < test.txt does not work the content of the file is not showing in notification
March 11, 20215 yr 2 minutes ago, Marcel40625 said: yeah but how can i attach the file or output from rsync to the notify command /usr/local/emhttp/webGui/scripts/notify -i normal -s "Test" -d "Test" -m < test.txt does not work the content of the file is not showing in notification Try MESSAGE=`rsync -av --delete --ignore-errors -e` /usr/local/emhttp/webGui/scripts/notify -i normal -s "Test" -d "Test" -m "$MESSAGE"
March 11, 20215 yr 51 minutes ago, ICDeadPpl said: Try MESSAGE=`rsync -av --delete --ignore-errors -e` /usr/local/emhttp/webGui/scripts/notify -i normal -s "Test" -d "Test" -m "$MESSAGE" thanks, but found out tail works /usr/local/emhttp/webGui/scripts/notify -i normal -s "Test" -d "Test" -m "`tail logfile.log`"
March 11, 20215 yr Author 3 minutes ago, Marcel40625 said: thanks, but found out tail works One problem with all of this is that IF there's a double quote within the output of the tail then you'll either get weird results in the message, or the notify command itself will fail.
March 11, 20215 yr 13 minutes ago, Squid said: One problem with all of this is that IF there's a double quote within the output of the tail then you'll either get weird results in the message, or the notify command itself will fail. thanks for the advice, but seems to work in this case and doesnt help ` ` for that? Edited March 11, 20215 yr by Marcel40625
March 16, 20215 yr plugin: installing: https://raw.githubusercontent.com/Squidly271/user.scripts/master/plugins/user.scripts.plg plugin: downloading https://raw.githubusercontent.com/Squidly271/user.scripts/master/plugins/user.scripts.plg plugin: downloading: https://raw.githubusercontent.com/Squidly271/user.scripts/master/plugins/user.scripts.plg ... done +============================================================================== | Installing new package /boot/config/plugins/user.scripts/user.scripts-2021.03.10-x86_64-1.txz +============================================================================== Verifying package user.scripts-2021.03.10-x86_64-1.txz. Unable to install /boot/config/plugins/user.scripts/user.scripts-2021.03.10-x86_64-1.txz: tar archive is corrupt (tar returned error code 2) ---------------------------------------------------- user.scripts has been installed. Copyright 2016-2020, Andrew Zawadzki Version: 2021.03.10 ---------------------------------------------------- plugin: user.scripts.plg installed what is the problem when I install this plugin...pls help, thx what is the problem when I install this plugin...pls help, thx what is the problem when I install this plugin...pls help, thx a lot
March 16, 20215 yr 4 hours ago, ajstaley33 said: when i set my script to run daily what time will it run? IIRC it will use the daily schedule set in Scheduler.
March 16, 20215 yr Author 4 minutes ago, wgstarks said: IIRC it will use the daily schedule set in Scheduler. Adjustable if you have The Schedules plugin installed
March 25, 20215 yr I am looking for a script that does the following: - check if cache is more than 60% ful - If so, then pause/stop all torrents in rtorrent and start mover - if cache is less than 60% full do nothing Anyone got a script like this?
March 28, 20215 yr On 3/25/2021 at 5:33 PM, ProphetSe7en said: I am looking for a script that does the following: - check if cache is more than 60% ful - If so, then pause/stop all torrents in rtorrent and start mover - if cache is less than 60% full do nothing Anyone got a script like this?
April 6, 20215 yr Thanks. That covers one part of want I want. Still need to figure out how to stop/pause all torrents and then restart them after mover is done
April 6, 20215 yr 11 minutes ago, ProphetSe7en said: Thanks. That covers one part of want I want. Still need to figure out how to stop/pause all torrents and then restart them after mover is done Without delving into whether it's possible to interact with rtorrent at that level, can't you just stop and start the docker with "docker stop <name-of-container>" and "docker start <name-of-container>" commands?
April 6, 20215 yr Probably, but stopping a torrent container can cause problems if a torrent is during dl or recently finished and no session has been saved the last 20 minutes. So I prefere to sett all active torrents in a pause state, run mover then resume all torrents
April 6, 20215 yr 29 minutes ago, ProphetSe7en said: Probably, but stopping a torrent container can cause problems if a torrent is during dl or recently finished and no session has been saved the last 20 minutes. So I prefere to sett all active torrents in a pause state, run mover then resume all torrents docker pause <name-of-container> / docker unpause <name-of-container> then?
April 6, 20215 yr Hmm. That might work, need to test it first Do you know if it is possible to issue the pause command only if cache is >60% full? No need to pause the container if mover wont run because of cache drive is less the 60% full. I know mover can be started using script, and from mover settings it wont run if cache is less than 60%. But while doing this with a script it will cause rtorrent to pause/resume each time the script runs regardless of mover will be running or not Edit: So I need to add the pause & unpause command to the mover script? Clearly the "docker pause/unpause rtorrentvpn" wont work like this, but what format should it be in to work? if ( $percent > $moveAt ) { docker pause rtorrentvpn; exec("/usr/local/sbin/mover"); docker unpause rtorrentvpn; } Edited April 6, 20215 yr by ProphetSe7en
April 6, 20215 yr 1 hour ago, ProphetSe7en said: Clearly the "docker pause/unpause rtorrentvpn" wont work like this, but what format should it be in to work? I'm not at my machine at the moment, but somebody else would know better. Your script would pause the docker (assuming that's the correct name), but I'm guessing it would unpause it straight away. You'd need a second part to the script in an else block that checks if docker is paused and whether the mover is running. If the mover has finished, unpause. Something like... if ( $percent > $moveAt ) { docker pause rtorrentvpn; exec("/usr/local/sbin/mover"); } else { if (!moverRunning && dockerIsPaused) { docker unpause rtorrentvpn; } } ...although without researching I don't know how to check if the mover is running and a docker is paused - this is just to illustrate the concept.
April 6, 20215 yr 6 hours ago, Cessquill said: I'm not at my machine at the moment, but somebody else would know better. Your script would pause the docker (assuming that's the correct name), but I'm guessing it would unpause it straight away. You'd need a second part to the script in an else block that checks if docker is paused and whether the mover is running. If the mover has finished, unpause. Something like... Hmm. I thought if I put the command under the "if" part of that script it would only be issued if the cache disk is >xx% ful, like the mover would in the script? Maybe I am mistaken, but in this script everything under "if" only runs if the disk threshold is met? #!/usr/bin/php <?PHP $moveAt = 70; # Adjust this value to suit. $diskTotal = disk_total_space("/mnt/cache"); $diskFree = disk_free_space("/mnt/cache"); $percent = ($diskTotal - $diskFree) / $diskTotal * 100; if ( $percent > $moveAt ) { exec("/usr/local/sbin/mover"); } ?> So I need to figure out on how to combine the script above with these commands. docker exec comand mover && docker exec comand (when mover is finished) Not very elegant, but can I replace exec("/usr/local/sbin/mover"); with exec("/mnt/user/various/unRaid/script/mover.sh); Then in the mover.sh I have the docker exec (command to pause all torrents) mover && docker exec (command to start all torrents) I get it to work, but then I dont have the threshold part in place.
April 8, 20215 yr Hey all, This might be a more generic unix question but is there an easy way to enable timestamps for all logs that a "userscript" would produce? quick googling i can do things like pipe my commands into various things to achieve this but i was wondering if there was an easy "turn on for everything in unraid" or maybe just "turn on for user scripts logs"? Thanks in advance!
April 27, 20215 yr Hello, i hava a cron job problem. I can't create a job with letters in day. This cron syntax 40 7 * * Tue sends an error in log "failed parsing crontab for user root: TUE" but 40 7 * * 2 works
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.