Restart shell script if not printingRun a script via cron every other weekUnable to print awk'ed datum in...
Does code obfuscation give any measurable security benefit?
Is it unusual that English uses possessive for past tense?
Rent a car for a day and leave it in another city in Italy
How long does it take to sail to Evermeet from the Neverwinter harbor?
Use a checkmark as a bullet
2000's spooky show with a group of teens telling spooky stories in the woods
Can elves trance in armor without any downsides?
Moonlight bright enough to see by
If you revoke a certificate authority's certificate, do all of the certificates it issued become invalid as well?
Is it poor workplace etiquette to display signs of relative "wealth" at work when others are struggling financially?
How can you tell apart the pronounciation at the end between the "meine" and "meiner" in the daily spoken situation?
What sport was she watching?
Largest number order in string
Given that an Octatonic Scale has 8 notes, what are the names of the scale intervals e.g. for a diminished scale?
Russian Caesar cipher
Why is Mars cold?
Is it possible for a country to develop the equivalent of a Second Industrial Revolution while under a war of attrition?
Are dead worlds a good galactic barrier?
How are Aircraft Noses Designed?
What actually is "unallocated space"?
I need an automatic way of making a lot of numbered folders
Where does the upgrade to macOS Catalina move root "/" directory files?
Prisoner's dilemma formulation for children
If we should encrypt the message rather than the method of transfer, why do we care about wifi security? Is this just security theatre?
Restart shell script if not printing
Run a script via cron every other weekUnable to print awk'ed datum in bash scriptScript to do periodic printingSetting environment variables with .bash_profile: only last export works properlyForce a job to come in foreground when asked for user input`sudo -u user script` does not even have access to /bin/sleepShell Script won't restart with user inputShellscript `grep` execution not working as in the interactive shell
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}
i have a shell script that just calls a python file in loop
eg:
for i in $(seq $start_index $end_index)
do
python my_script.py
done
The python process halts when it is not able to generate random numbers in certain ranges.
i am trying to restart the script when it has not printed out to the console for say 30 seconds, else it can keep running.
This is not a cron job which needs to necessarily restart in a fixed interval.
However, a watchdog kind of job that can track would be ideal; but i did not find anything that tracks when was the last output printed.
We could also direct the output from script.sh > log.txt and check for when was the file last modified, but didn't find an elegant way of doing that.
Any help/pointers would be appreciated.
bash shell-script shell gnu-screen watchdog
New contributor
gmalik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment
|
i have a shell script that just calls a python file in loop
eg:
for i in $(seq $start_index $end_index)
do
python my_script.py
done
The python process halts when it is not able to generate random numbers in certain ranges.
i am trying to restart the script when it has not printed out to the console for say 30 seconds, else it can keep running.
This is not a cron job which needs to necessarily restart in a fixed interval.
However, a watchdog kind of job that can track would be ideal; but i did not find anything that tracks when was the last output printed.
We could also direct the output from script.sh > log.txt and check for when was the file last modified, but didn't find an elegant way of doing that.
Any help/pointers would be appreciated.
bash shell-script shell gnu-screen watchdog
New contributor
gmalik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment
|
i have a shell script that just calls a python file in loop
eg:
for i in $(seq $start_index $end_index)
do
python my_script.py
done
The python process halts when it is not able to generate random numbers in certain ranges.
i am trying to restart the script when it has not printed out to the console for say 30 seconds, else it can keep running.
This is not a cron job which needs to necessarily restart in a fixed interval.
However, a watchdog kind of job that can track would be ideal; but i did not find anything that tracks when was the last output printed.
We could also direct the output from script.sh > log.txt and check for when was the file last modified, but didn't find an elegant way of doing that.
Any help/pointers would be appreciated.
bash shell-script shell gnu-screen watchdog
New contributor
gmalik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
i have a shell script that just calls a python file in loop
eg:
for i in $(seq $start_index $end_index)
do
python my_script.py
done
The python process halts when it is not able to generate random numbers in certain ranges.
i am trying to restart the script when it has not printed out to the console for say 30 seconds, else it can keep running.
This is not a cron job which needs to necessarily restart in a fixed interval.
However, a watchdog kind of job that can track would be ideal; but i did not find anything that tracks when was the last output printed.
We could also direct the output from script.sh > log.txt and check for when was the file last modified, but didn't find an elegant way of doing that.
Any help/pointers would be appreciated.
bash shell-script shell gnu-screen watchdog
bash shell-script shell gnu-screen watchdog
New contributor
gmalik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
gmalik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
gmalik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 1 hour ago
gmalikgmalik
1
1
New contributor
gmalik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
gmalik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment
|
add a comment
|
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
gmalik is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f546231%2frestart-shell-script-if-not-printing%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
gmalik is a new contributor. Be nice, and check out our Code of Conduct.
gmalik is a new contributor. Be nice, and check out our Code of Conduct.
gmalik is a new contributor. Be nice, and check out our Code of Conduct.
gmalik is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f546231%2frestart-shell-script-if-not-printing%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown