...
Does any one know how I can make restart.sh run with the same permissions as /sbin/reboot without needing to enter a password?
I've never had to do this but this is probably what you need, basically it whitelists a script/binary to run as root so you don't need to authenticate as you try to run it:
https://unix.stackexchange.com/ques...fic-program-as-root-without-a-password-prompt
Well done going the Debian route. You have made it hard on yourself using Debian with nvidia hardware especially, reading this thread is a bit like a blast from the past wifi issues and everything. The route I would recommend for other people to switch to Linux would be Ubuntu or Fedora, both are popular which helps iron out issues with plenty of eyes on them and they are beginner-friendly. Personally I ignore the multitude of distro derivatives that mostly boil down to being Ubuntu/Fedora/Debian with a different skin, noob traps IMO. Fedora and Ubuntu are also relatively modern in how fast they update their packages and kernel etc which helps with compatibility with hardware, as does making it easy to use proprietary packages when necessary (nvidia). Fedora updates most things faster which is important to me and why I switched to it from Ubuntu some time ago, but I don't begrudge anyone who chooses Ubuntu they're both fine.
Found a script that will run the scrub task
#!/bin/bash
POOL="Tank" # Replace with your pool name
zpool scrub $POOL
added the line to sudo cron -e
@weekly /usr/bin/zfs-scrub.sh
To run the scrub job weekly
Don't forget that the scripts need to be sudo chmod +x <your.sh> to make them executable.
You probably know this by now, but if not this'll help you with bash stuff in the future. The first line defines the execution environment, it's normally /bin/bash or /bin/sh but sometimes you'll see python and others.
defines a variable POOL with value "Tank". $POOL is simply replaced with "Tank" wherever it's used. So all the script does is run
There's about a dozen other simple things you could learn about bash/scripts if you want to get competent in understanding/writing commands (loops, if statements, special variables like $n with n a number for args passed to the script, $? to get the exit code of the last executed binary to be able to do things based on the success of other things, just these things covers a good chunk of common stuff).
One other bit of info that I would've found invaluable when I started with Linux, man pages are an excellent way to understand tools.
is like help text on steroids, most tools have a man page and they're searchable.