Run custom shell script (not at boot time)
-
Hi guys.
I was trying to search the answer but only found how to run script at the boot.
Here is my question.
I want some maintenance run at night (2am), when not much is going on on my LAN.
I wrote the script, made it executable, add new cron job using crontab -e…
But nothing went through. I tried to run script manually from CLI, and it didn't go.
How can I do this?
Thanks.
-
Not really much info provided to go on so I’ll attempt being clairvoyant.
Try this
login as root
cd to script directory
chmod 777 script_file
./script_fileIf that does not work then something is probably wrong with the script. Make a simple script to echo something out to the console and see if that will run.
-
nope…. :(
doesn't work. See attached screen shot.
EDIT:
works. It was my mistake. I put !/bin/bash instead of /bin/sh...
Thanks for reply.
All the best.

 -
Your edits to crontab will get lost when you reboot - pfSense rebuilds all that from its config at boot time. Install the cron package and use that to add your cron job. It will survive reboot.
-
Thanks!
I did as you advised.
All the best.