Jump to content

cron job help

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

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. 

 

"Beast Mode"

Ryzen 7 9800x3d | Arctic Liquid Freeze 3 Pro 360 | MSI X870 Tomahawk Wi-Fi | MSI RTX 5080 Gaming Trio OC | Gskill Flare X5 6000MT/s CL30

1tb WD Black SN850x NVMe | 4tb WD SN850x NVMe | Antec Flux Pro | Be Quiet Pure Power 13 M 1000w | OWC 10gb NIC

 

Dedicated Streaming Rig

 Ryzen 7 3700x | Asus B450-F Strix | 32gb Gskill Flare X 3200mhz | Corsair RM550x PSU | MSI Ventus 3060 12gb | 250gb 860 Evo m.2

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

 

Link to comment
https://linustechtips.com/topic/1089856-cron-job-help/
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
https://linustechtips.com/topic/1089856-cron-job-help/#findComment-12774764
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

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. 

 

"Beast Mode"

Ryzen 7 9800x3d | Arctic Liquid Freeze 3 Pro 360 | MSI X870 Tomahawk Wi-Fi | MSI RTX 5080 Gaming Trio OC | Gskill Flare X5 6000MT/s CL30

1tb WD Black SN850x NVMe | 4tb WD SN850x NVMe | Antec Flux Pro | Be Quiet Pure Power 13 M 1000w | OWC 10gb NIC

 

Dedicated Streaming Rig

 Ryzen 7 3700x | Asus B450-F Strix | 32gb Gskill Flare X 3200mhz | Corsair RM550x PSU | MSI Ventus 3060 12gb | 250gb 860 Evo m.2

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

 

Link to comment
https://linustechtips.com/topic/1089856-cron-job-help/#findComment-12774774
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
https://linustechtips.com/topic/1089856-cron-job-help/#findComment-12774794
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

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. 

 

"Beast Mode"

Ryzen 7 9800x3d | Arctic Liquid Freeze 3 Pro 360 | MSI X870 Tomahawk Wi-Fi | MSI RTX 5080 Gaming Trio OC | Gskill Flare X5 6000MT/s CL30

1tb WD Black SN850x NVMe | 4tb WD SN850x NVMe | Antec Flux Pro | Be Quiet Pure Power 13 M 1000w | OWC 10gb NIC

 

Dedicated Streaming Rig

 Ryzen 7 3700x | Asus B450-F Strix | 32gb Gskill Flare X 3200mhz | Corsair RM550x PSU | MSI Ventus 3060 12gb | 250gb 860 Evo m.2

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

 

Link to comment
https://linustechtips.com/topic/1089856-cron-job-help/#findComment-12774800
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

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. 

 

"Beast Mode"

Ryzen 7 9800x3d | Arctic Liquid Freeze 3 Pro 360 | MSI X870 Tomahawk Wi-Fi | MSI RTX 5080 Gaming Trio OC | Gskill Flare X5 6000MT/s CL30

1tb WD Black SN850x NVMe | 4tb WD SN850x NVMe | Antec Flux Pro | Be Quiet Pure Power 13 M 1000w | OWC 10gb NIC

 

Dedicated Streaming Rig

 Ryzen 7 3700x | Asus B450-F Strix | 32gb Gskill Flare X 3200mhz | Corsair RM550x PSU | MSI Ventus 3060 12gb | 250gb 860 Evo m.2

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

 

Link to comment
https://linustechtips.com/topic/1089856-cron-job-help/#findComment-12774843
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

×