What's new

Create a Cron Job to Run on a Schedule

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

T0mmy1977

New Around Here
I need to run the following command on a schedule for WoL purposes.

arp -s IP MAC

I have the command in the services-start file, but the ARP table gets flushed. I am new to cron jobs. Can you please tell me how to run the command on a schedule? Thanks
 
Maybe this is working for you?

 
It still doesn't work. Any ideas? I tried these entries in services start.

/usr/sbin/cru a WoL1 "10 * * * * arp -s IP MAC"
cru a WoL1 "10 * * * * arp -s IP MAC"
 
You did reboot the router didn't you?

Check that the script has run successfully by looking at the output of:
Code:
cru l

P.S. You can post your output if you want to. The MAC address and IP address are not sensitive information.
 
I did reboot the router. I get the following when I type cru l.

10 * * * * arp -s 192.168.1.101 MAC #WoL1#
10 * * * * arp -s 192.168.1.102 MAC #WoL2#
*/59 * * * * service restart_letsencrypt #LetsEncrypt#
 
I assume "MAC" is actually a MAC address in the correct format?

Those arp commands will only run once an hour at 10 minutes past the hour. From the reports I've read it seems like once an hour is to long. I suggest you use my suggested command ("*/10") to run it every 10 minutes.
 
I changed the timing to */10 and I get the output below, but it still fails to show as PERM when I run the arp command after 10 minutes.

Code:
*/10 * * * * arp -s 192.168.1.101 D8:BB:C1:8E:DD:33 #WoL1#
*/10 * * * * arp -s 192.168.1.102 04:7C:16:6E:6D:AC #WoL2#
30 12 * * * service restart_letsencrypt #LetsEncrypt#
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top