Jump to content

cron job help

Skiiwee29
Go to solution Solved by Skiiwee29,
18 minutes ago, vorticalbox said:

that is a shame :/

you should be able to use the ceon i posted and then poi t it to a sh script

 

https://www.geeksforgeeks.org/how-to-setup-cron-jobs-in-ubuntu/

 

 

so after searching more and doing more and more research, I was able to find a way to get a KRON job up on the Cisco device that should do the trick I need. 

Hey guys, In a pickle here and I am very lost... need to create a cron job on a linux server to SSH over to a different device and run a certain command on a 4hr timer. I have the timer written.. I think? But I honestly have no clue how to write the bash script to execute it. This is in a CentOS based linux server.

 

Here is the cron job I came up with based on quick research.

 

30 0,4,8,12,16,20 * * * /root/bash script file

 

From my understanding, this should tell the server that at 30 minutes past every 4hrs it should execute correct?

 

Its simple, its needs to SSH over to the device and run a single command and thats it. Any help would be greatly appreciated. 

 

Community Standards | Fan Control Software

Please make sure to Quote me or @ me to see your reply!

Just because I am a Moderator does not mean I am always right. Please fact check me and verify my answer. 

 

"Black Out"

Ryzen 9 5900x | Full Custom Water Loop | Asus Crosshair VIII Hero (Wi-Fi) | RTX 3090 Founders | Ballistix 32gb 16-18-18-36 3600mhz 

1tb Samsung 970 Evo | 2x 2tb Crucial MX500 SSD | Fractal Design Meshify S2 | Corsair HX1200 PSU

 

Dedicated Streaming Rig

 Ryzen 7 3700x | Asus B450-F Strix | 16gb Gskill Flare X 3200mhz | Corsair RM550x PSU | Asus Strix GTX1070 | 250gb 860 Evo m.2

Phanteks P300A |  Elgato HD60 Pro | Avermedia Live Gamer Duo | Avermedia 4k GC573 Capture Card

 

Link to comment
Share on other sites

Link to post
Share on other sites

Why not run the corn job of the other device and avoid remote shells?

 

0 */4 * * * should run every 4 hours

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, vorticalbox said:

Why not run the corn job of the other device and avoid remote shells?

 

0 */4 * * * should run every 4 hours

Its a cisco ASR1K router, which to my knowledge has no support for scripting jobs. 

Community Standards | Fan Control Software

Please make sure to Quote me or @ me to see your reply!

Just because I am a Moderator does not mean I am always right. Please fact check me and verify my answer. 

 

"Black Out"

Ryzen 9 5900x | Full Custom Water Loop | Asus Crosshair VIII Hero (Wi-Fi) | RTX 3090 Founders | Ballistix 32gb 16-18-18-36 3600mhz 

1tb Samsung 970 Evo | 2x 2tb Crucial MX500 SSD | Fractal Design Meshify S2 | Corsair HX1200 PSU

 

Dedicated Streaming Rig

 Ryzen 7 3700x | Asus B450-F Strix | 16gb Gskill Flare X 3200mhz | Corsair RM550x PSU | Asus Strix GTX1070 | 250gb 860 Evo m.2

Phanteks P300A |  Elgato HD60 Pro | Avermedia Live Gamer Duo | Avermedia 4k GC573 Capture Card

 

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Skiiwee29 said:

Its a cisco ASR1K router, which to my knowledge has no support for scripting jobs. 

that is a shame :/

you should be able to use the ceon i posted and then poi t it to a sh script

 

https://www.geeksforgeeks.org/how-to-setup-cron-jobs-in-ubuntu/

 

 

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, vorticalbox said:

that is a shame :/

you should be able to use the ceon i posted and then poi t it to a sh script

 

https://www.geeksforgeeks.org/how-to-setup-cron-jobs-in-ubuntu/

 

 

Right, but I dont know how to write/format the sh script.. thats the part I need help with mostly. 

Community Standards | Fan Control Software

Please make sure to Quote me or @ me to see your reply!

Just because I am a Moderator does not mean I am always right. Please fact check me and verify my answer. 

 

"Black Out"

Ryzen 9 5900x | Full Custom Water Loop | Asus Crosshair VIII Hero (Wi-Fi) | RTX 3090 Founders | Ballistix 32gb 16-18-18-36 3600mhz 

1tb Samsung 970 Evo | 2x 2tb Crucial MX500 SSD | Fractal Design Meshify S2 | Corsair HX1200 PSU

 

Dedicated Streaming Rig

 Ryzen 7 3700x | Asus B450-F Strix | 16gb Gskill Flare X 3200mhz | Corsair RM550x PSU | Asus Strix GTX1070 | 250gb 860 Evo m.2

Phanteks P300A |  Elgato HD60 Pro | Avermedia Live Gamer Duo | Avermedia 4k GC573 Capture Card

 

Link to comment
Share on other sites

Link to post
Share on other sites

18 minutes ago, vorticalbox said:

that is a shame :/

you should be able to use the ceon i posted and then poi t it to a sh script

 

https://www.geeksforgeeks.org/how-to-setup-cron-jobs-in-ubuntu/

 

 

so after searching more and doing more and more research, I was able to find a way to get a KRON job up on the Cisco device that should do the trick I need. 

Community Standards | Fan Control Software

Please make sure to Quote me or @ me to see your reply!

Just because I am a Moderator does not mean I am always right. Please fact check me and verify my answer. 

 

"Black Out"

Ryzen 9 5900x | Full Custom Water Loop | Asus Crosshair VIII Hero (Wi-Fi) | RTX 3090 Founders | Ballistix 32gb 16-18-18-36 3600mhz 

1tb Samsung 970 Evo | 2x 2tb Crucial MX500 SSD | Fractal Design Meshify S2 | Corsair HX1200 PSU

 

Dedicated Streaming Rig

 Ryzen 7 3700x | Asus B450-F Strix | 16gb Gskill Flare X 3200mhz | Corsair RM550x PSU | Asus Strix GTX1070 | 250gb 860 Evo m.2

Phanteks P300A |  Elgato HD60 Pro | Avermedia Live Gamer Duo | Avermedia 4k GC573 Capture Card

 

Link to comment
Share on other sites

Link to post
Share on other sites

If you have no experience with setting up cron jobs on servers or don't have access to do it, you can use a third party solution like Easycron.com who will call your URL at a specific time.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×