April 1, 20206 yr I have been using cron to run a couple of scripts and last week I got this error email: cron for user root /boot/config/my_scripts/list_disks.sh Console and webGui login account <xxxx.x.xxx3@gmail.com> Mar 29, 2020, 4:00 AM (3 days ago) to root, bcc: me /bin/sh: /boot/config/my_scripts/list_disks.sh: Permission denied Here is the relevant cron entry: # run backup script on Home\ Video to copy to Backup1 every Sunday at 4am 0 4 * * 0 /boot/config/my_scripts/backup_home_video.sh # run script to list individual disk contents 0 4 * * 0 /boot/config/my_scripts/list_disks.sh I checked and, indeed, the script file not longer has execute permission. I attempted to add execute permission (sudo chmod +x list_disk.sh) but that failed silently. root@Tower:/boot/config/my_scripts# ls -l total 192 -rw------- 1 root root 640 Jan 6 11:30 backup_home_video.sh -rw------- 1 root root 305 Jan 27 16:06 directory_size.sh -rw------- 1 root root 717 Oct 29 2018 list_disks.sh -rw------- 1 root root 85224 Jul 12 2018 test.sh Any idea what caused this? It has been working fine for over a year now. Currently running 6.8.2
April 1, 20206 yr Community Expert You cannot set the execute bit for files that are on the flash drive (this was a security change made a few releases ago). The easiest way around this is to use the User Scripts plugin which will handle this for you.
April 2, 20206 yr Author 21 hours ago, itimpi said: You cannot set the execute bit for files that are on the flash drive (this was a security change made a few releases ago). The easiest way around this is to use the User Scripts plugin which will handle this for you. Hmm. I don't see why that would help security, but good to know. I set up the scripts in user scripts and we'll see what happens. Thanks.
March 16, 20224 yr any idea then, how to make scripts executable in /boot/config/plugins/check_mk_agent/plugins which is needed for custom checks to work? my workaround is to create a (hidden) share called check_mk_plugins and symlink it ln -s /mnt/user/check_mk_plugins /usr/lib/check_mk_agent/plugins but I will probably need to add the symlink line to a startup script. Edited March 16, 20224 yr by Osiris
March 16, 20224 yr Community Expert The ability have executeable files on the flash was removed some Unraid releases ago as part of tightening security. another workaround is to precede the script name with ‘sh’ or ‘bash’.
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.