Swap config files at certain times [duplicate]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite













This question already has an answer here:



  • How to execute a script periodically without using crontab?

    2 answers



  • How do I set up a Cron job?

    6 answers



I am trying to make a script that switches files at different times of days so that my settings are pulled at different times like a day mode and a night mode.



If I have a file 1, 2, and 3 which 3 is a group of settings for my server. I want to switch out 1 to become 3 from 8am to 6pm. then I want 2 to become 3 from 6pm to 8am automatically. How can I do this though shell script? I just want to basically do a cp -v 1 3 then cp -v 2 3 on a schedule how would I accomplish this? thanks in advance!
I don't want to do it through cron i want to do it through shell script only, if possible!!










share|improve this question















marked as duplicate by muru, wjandrea, Terrance, Zanna, Eric Carvalho Mar 10 at 12:49


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 1




    Why not through cron?
    – muru
    Mar 9 at 2:05










  • If not via cron, then: askubuntu.com/q/844533/158442
    – muru
    Mar 9 at 2:07






  • 1




    Yes you can do it via script only; the script sleeps for xx hours on a cycle, but why? cron is more resource efficient. You realize if you switch configs, whatever processes using them will probably need restart (to read the altered config) as they'll likely be reading/using the old config (inode)
    – guiverc
    Mar 9 at 2:10










  • Because I'm trying to make it a self contained shell script that i can save on various servers and just run the shell when I want from putty real quick. It is a random thing. More detail on what im doing is running a Zcash miner in ubuntu. and one pool pays good when it finds block but rarely finds blocks so when i see its been 24-48 hours since they've found a block i just want to run the script and switch pools. Because generally once they got that long without a block they are close to finding on and then i wanna switch back to my more steady pay out pool after say 12 hours
    – Colt Burdine
    Mar 9 at 2:14










  • If you guys think cron is the way to go still ill do it and yes the process needs to be restarted but i know how to restart it in the script when the script runs.
    – Colt Burdine
    Mar 9 at 2:15














up vote
0
down vote

favorite













This question already has an answer here:



  • How to execute a script periodically without using crontab?

    2 answers



  • How do I set up a Cron job?

    6 answers



I am trying to make a script that switches files at different times of days so that my settings are pulled at different times like a day mode and a night mode.



If I have a file 1, 2, and 3 which 3 is a group of settings for my server. I want to switch out 1 to become 3 from 8am to 6pm. then I want 2 to become 3 from 6pm to 8am automatically. How can I do this though shell script? I just want to basically do a cp -v 1 3 then cp -v 2 3 on a schedule how would I accomplish this? thanks in advance!
I don't want to do it through cron i want to do it through shell script only, if possible!!










share|improve this question















marked as duplicate by muru, wjandrea, Terrance, Zanna, Eric Carvalho Mar 10 at 12:49


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 1




    Why not through cron?
    – muru
    Mar 9 at 2:05










  • If not via cron, then: askubuntu.com/q/844533/158442
    – muru
    Mar 9 at 2:07






  • 1




    Yes you can do it via script only; the script sleeps for xx hours on a cycle, but why? cron is more resource efficient. You realize if you switch configs, whatever processes using them will probably need restart (to read the altered config) as they'll likely be reading/using the old config (inode)
    – guiverc
    Mar 9 at 2:10










  • Because I'm trying to make it a self contained shell script that i can save on various servers and just run the shell when I want from putty real quick. It is a random thing. More detail on what im doing is running a Zcash miner in ubuntu. and one pool pays good when it finds block but rarely finds blocks so when i see its been 24-48 hours since they've found a block i just want to run the script and switch pools. Because generally once they got that long without a block they are close to finding on and then i wanna switch back to my more steady pay out pool after say 12 hours
    – Colt Burdine
    Mar 9 at 2:14










  • If you guys think cron is the way to go still ill do it and yes the process needs to be restarted but i know how to restart it in the script when the script runs.
    – Colt Burdine
    Mar 9 at 2:15












up vote
0
down vote

favorite









up vote
0
down vote

favorite












This question already has an answer here:



  • How to execute a script periodically without using crontab?

    2 answers



  • How do I set up a Cron job?

    6 answers



I am trying to make a script that switches files at different times of days so that my settings are pulled at different times like a day mode and a night mode.



If I have a file 1, 2, and 3 which 3 is a group of settings for my server. I want to switch out 1 to become 3 from 8am to 6pm. then I want 2 to become 3 from 6pm to 8am automatically. How can I do this though shell script? I just want to basically do a cp -v 1 3 then cp -v 2 3 on a schedule how would I accomplish this? thanks in advance!
I don't want to do it through cron i want to do it through shell script only, if possible!!










share|improve this question
















This question already has an answer here:



  • How to execute a script periodically without using crontab?

    2 answers



  • How do I set up a Cron job?

    6 answers



I am trying to make a script that switches files at different times of days so that my settings are pulled at different times like a day mode and a night mode.



If I have a file 1, 2, and 3 which 3 is a group of settings for my server. I want to switch out 1 to become 3 from 8am to 6pm. then I want 2 to become 3 from 6pm to 8am automatically. How can I do this though shell script? I just want to basically do a cp -v 1 3 then cp -v 2 3 on a schedule how would I accomplish this? thanks in advance!
I don't want to do it through cron i want to do it through shell script only, if possible!!





This question already has an answer here:



  • How to execute a script periodically without using crontab?

    2 answers



  • How do I set up a Cron job?

    6 answers







scripts schedule






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 9 at 2:04

























asked Mar 9 at 1:55









Colt Burdine

61




61




marked as duplicate by muru, wjandrea, Terrance, Zanna, Eric Carvalho Mar 10 at 12:49


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by muru, wjandrea, Terrance, Zanna, Eric Carvalho Mar 10 at 12:49


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









  • 1




    Why not through cron?
    – muru
    Mar 9 at 2:05










  • If not via cron, then: askubuntu.com/q/844533/158442
    – muru
    Mar 9 at 2:07






  • 1




    Yes you can do it via script only; the script sleeps for xx hours on a cycle, but why? cron is more resource efficient. You realize if you switch configs, whatever processes using them will probably need restart (to read the altered config) as they'll likely be reading/using the old config (inode)
    – guiverc
    Mar 9 at 2:10










  • Because I'm trying to make it a self contained shell script that i can save on various servers and just run the shell when I want from putty real quick. It is a random thing. More detail on what im doing is running a Zcash miner in ubuntu. and one pool pays good when it finds block but rarely finds blocks so when i see its been 24-48 hours since they've found a block i just want to run the script and switch pools. Because generally once they got that long without a block they are close to finding on and then i wanna switch back to my more steady pay out pool after say 12 hours
    – Colt Burdine
    Mar 9 at 2:14










  • If you guys think cron is the way to go still ill do it and yes the process needs to be restarted but i know how to restart it in the script when the script runs.
    – Colt Burdine
    Mar 9 at 2:15












  • 1




    Why not through cron?
    – muru
    Mar 9 at 2:05










  • If not via cron, then: askubuntu.com/q/844533/158442
    – muru
    Mar 9 at 2:07






  • 1




    Yes you can do it via script only; the script sleeps for xx hours on a cycle, but why? cron is more resource efficient. You realize if you switch configs, whatever processes using them will probably need restart (to read the altered config) as they'll likely be reading/using the old config (inode)
    – guiverc
    Mar 9 at 2:10










  • Because I'm trying to make it a self contained shell script that i can save on various servers and just run the shell when I want from putty real quick. It is a random thing. More detail on what im doing is running a Zcash miner in ubuntu. and one pool pays good when it finds block but rarely finds blocks so when i see its been 24-48 hours since they've found a block i just want to run the script and switch pools. Because generally once they got that long without a block they are close to finding on and then i wanna switch back to my more steady pay out pool after say 12 hours
    – Colt Burdine
    Mar 9 at 2:14










  • If you guys think cron is the way to go still ill do it and yes the process needs to be restarted but i know how to restart it in the script when the script runs.
    – Colt Burdine
    Mar 9 at 2:15







1




1




Why not through cron?
– muru
Mar 9 at 2:05




Why not through cron?
– muru
Mar 9 at 2:05












If not via cron, then: askubuntu.com/q/844533/158442
– muru
Mar 9 at 2:07




If not via cron, then: askubuntu.com/q/844533/158442
– muru
Mar 9 at 2:07




1




1




Yes you can do it via script only; the script sleeps for xx hours on a cycle, but why? cron is more resource efficient. You realize if you switch configs, whatever processes using them will probably need restart (to read the altered config) as they'll likely be reading/using the old config (inode)
– guiverc
Mar 9 at 2:10




Yes you can do it via script only; the script sleeps for xx hours on a cycle, but why? cron is more resource efficient. You realize if you switch configs, whatever processes using them will probably need restart (to read the altered config) as they'll likely be reading/using the old config (inode)
– guiverc
Mar 9 at 2:10












Because I'm trying to make it a self contained shell script that i can save on various servers and just run the shell when I want from putty real quick. It is a random thing. More detail on what im doing is running a Zcash miner in ubuntu. and one pool pays good when it finds block but rarely finds blocks so when i see its been 24-48 hours since they've found a block i just want to run the script and switch pools. Because generally once they got that long without a block they are close to finding on and then i wanna switch back to my more steady pay out pool after say 12 hours
– Colt Burdine
Mar 9 at 2:14




Because I'm trying to make it a self contained shell script that i can save on various servers and just run the shell when I want from putty real quick. It is a random thing. More detail on what im doing is running a Zcash miner in ubuntu. and one pool pays good when it finds block but rarely finds blocks so when i see its been 24-48 hours since they've found a block i just want to run the script and switch pools. Because generally once they got that long without a block they are close to finding on and then i wanna switch back to my more steady pay out pool after say 12 hours
– Colt Burdine
Mar 9 at 2:14












If you guys think cron is the way to go still ill do it and yes the process needs to be restarted but i know how to restart it in the script when the script runs.
– Colt Burdine
Mar 9 at 2:15




If you guys think cron is the way to go still ill do it and yes the process needs to be restarted but i know how to restart it in the script when the script runs.
– Colt Burdine
Mar 9 at 2:15















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491