Does a job scheduled in crontab run even when I log out?
I add some job in crontab file on a server.
When I log out and the server is still on, will the job still run?
Does it matter if I create a screen or tmux session and run some shell in it and detach it before log out?
cron
add a comment |
I add some job in crontab file on a server.
When I log out and the server is still on, will the job still run?
Does it matter if I create a screen or tmux session and run some shell in it and detach it before log out?
cron
add a comment |
I add some job in crontab file on a server.
When I log out and the server is still on, will the job still run?
Does it matter if I create a screen or tmux session and run some shell in it and detach it before log out?
cron
I add some job in crontab file on a server.
When I log out and the server is still on, will the job still run?
Does it matter if I create a screen or tmux session and run some shell in it and detach it before log out?
cron
cron
asked Apr 21 '15 at 13:03
TimTim
26.3k74246455
26.3k74246455
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
cron
is a process which deals with scheduled tasks whether you are logged in or not. It is not necessary to have a screen or tmux session running since the cron daemon will execute the scheduled tasks in separate shells.
See man cron
and man crontab
for details.
when I log out, which user will run and own the job scheduled in crontab? If it is not me, can that cause some potential problem?
– Tim
Apr 21 '15 at 13:08
That depends on which crontab you edited. If you edit the crontab of a user the entries are executed as that user. If you edited the /etc/crontab file the user is often specified between the interval and the command like: "17 * * * * root cd / && run-parts --report /etc/cron.hourly". Besides it does also depend on the platform you are using. Ubuntu uses a different cron than for instance Solaris
– Lambert
Apr 21 '15 at 13:14
I use ubuntu. What is "the crontab of a user"? In "the crontab of a user", can I also specify which user will run a scheduled job?
– Tim
Apr 21 '15 at 13:26
Ubuntu cron has some explanation text in the crontab files. As a user performcrontab -e
to read about the user crontab file andcat /etc/crontab
to read about the server-wide crontab file. From a user crontab file you can not run commands using a different user although it is possible to use sudo if passwordless commands are specified
– Lambert
Apr 21 '15 at 13:33
Thanks./etc/crontab
is for system-wide, then where is the crontab file for a user?
– Tim
Apr 21 '15 at 19:42
|
show 4 more comments
The crontab file for a user is edited by running 'crontab -e'.
New contributor
add a comment |
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/3.0/"u003ecc by-sa 3.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
});
}
});
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%2f197615%2fdoes-a-job-scheduled-in-crontab-run-even-when-i-log-out%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
cron
is a process which deals with scheduled tasks whether you are logged in or not. It is not necessary to have a screen or tmux session running since the cron daemon will execute the scheduled tasks in separate shells.
See man cron
and man crontab
for details.
when I log out, which user will run and own the job scheduled in crontab? If it is not me, can that cause some potential problem?
– Tim
Apr 21 '15 at 13:08
That depends on which crontab you edited. If you edit the crontab of a user the entries are executed as that user. If you edited the /etc/crontab file the user is often specified between the interval and the command like: "17 * * * * root cd / && run-parts --report /etc/cron.hourly". Besides it does also depend on the platform you are using. Ubuntu uses a different cron than for instance Solaris
– Lambert
Apr 21 '15 at 13:14
I use ubuntu. What is "the crontab of a user"? In "the crontab of a user", can I also specify which user will run a scheduled job?
– Tim
Apr 21 '15 at 13:26
Ubuntu cron has some explanation text in the crontab files. As a user performcrontab -e
to read about the user crontab file andcat /etc/crontab
to read about the server-wide crontab file. From a user crontab file you can not run commands using a different user although it is possible to use sudo if passwordless commands are specified
– Lambert
Apr 21 '15 at 13:33
Thanks./etc/crontab
is for system-wide, then where is the crontab file for a user?
– Tim
Apr 21 '15 at 19:42
|
show 4 more comments
cron
is a process which deals with scheduled tasks whether you are logged in or not. It is not necessary to have a screen or tmux session running since the cron daemon will execute the scheduled tasks in separate shells.
See man cron
and man crontab
for details.
when I log out, which user will run and own the job scheduled in crontab? If it is not me, can that cause some potential problem?
– Tim
Apr 21 '15 at 13:08
That depends on which crontab you edited. If you edit the crontab of a user the entries are executed as that user. If you edited the /etc/crontab file the user is often specified between the interval and the command like: "17 * * * * root cd / && run-parts --report /etc/cron.hourly". Besides it does also depend on the platform you are using. Ubuntu uses a different cron than for instance Solaris
– Lambert
Apr 21 '15 at 13:14
I use ubuntu. What is "the crontab of a user"? In "the crontab of a user", can I also specify which user will run a scheduled job?
– Tim
Apr 21 '15 at 13:26
Ubuntu cron has some explanation text in the crontab files. As a user performcrontab -e
to read about the user crontab file andcat /etc/crontab
to read about the server-wide crontab file. From a user crontab file you can not run commands using a different user although it is possible to use sudo if passwordless commands are specified
– Lambert
Apr 21 '15 at 13:33
Thanks./etc/crontab
is for system-wide, then where is the crontab file for a user?
– Tim
Apr 21 '15 at 19:42
|
show 4 more comments
cron
is a process which deals with scheduled tasks whether you are logged in or not. It is not necessary to have a screen or tmux session running since the cron daemon will execute the scheduled tasks in separate shells.
See man cron
and man crontab
for details.
cron
is a process which deals with scheduled tasks whether you are logged in or not. It is not necessary to have a screen or tmux session running since the cron daemon will execute the scheduled tasks in separate shells.
See man cron
and man crontab
for details.
edited Jan 11 '18 at 11:52
Jeff Schaller
39k1053125
39k1053125
answered Apr 21 '15 at 13:07
LambertLambert
8,85721128
8,85721128
when I log out, which user will run and own the job scheduled in crontab? If it is not me, can that cause some potential problem?
– Tim
Apr 21 '15 at 13:08
That depends on which crontab you edited. If you edit the crontab of a user the entries are executed as that user. If you edited the /etc/crontab file the user is often specified between the interval and the command like: "17 * * * * root cd / && run-parts --report /etc/cron.hourly". Besides it does also depend on the platform you are using. Ubuntu uses a different cron than for instance Solaris
– Lambert
Apr 21 '15 at 13:14
I use ubuntu. What is "the crontab of a user"? In "the crontab of a user", can I also specify which user will run a scheduled job?
– Tim
Apr 21 '15 at 13:26
Ubuntu cron has some explanation text in the crontab files. As a user performcrontab -e
to read about the user crontab file andcat /etc/crontab
to read about the server-wide crontab file. From a user crontab file you can not run commands using a different user although it is possible to use sudo if passwordless commands are specified
– Lambert
Apr 21 '15 at 13:33
Thanks./etc/crontab
is for system-wide, then where is the crontab file for a user?
– Tim
Apr 21 '15 at 19:42
|
show 4 more comments
when I log out, which user will run and own the job scheduled in crontab? If it is not me, can that cause some potential problem?
– Tim
Apr 21 '15 at 13:08
That depends on which crontab you edited. If you edit the crontab of a user the entries are executed as that user. If you edited the /etc/crontab file the user is often specified between the interval and the command like: "17 * * * * root cd / && run-parts --report /etc/cron.hourly". Besides it does also depend on the platform you are using. Ubuntu uses a different cron than for instance Solaris
– Lambert
Apr 21 '15 at 13:14
I use ubuntu. What is "the crontab of a user"? In "the crontab of a user", can I also specify which user will run a scheduled job?
– Tim
Apr 21 '15 at 13:26
Ubuntu cron has some explanation text in the crontab files. As a user performcrontab -e
to read about the user crontab file andcat /etc/crontab
to read about the server-wide crontab file. From a user crontab file you can not run commands using a different user although it is possible to use sudo if passwordless commands are specified
– Lambert
Apr 21 '15 at 13:33
Thanks./etc/crontab
is for system-wide, then where is the crontab file for a user?
– Tim
Apr 21 '15 at 19:42
when I log out, which user will run and own the job scheduled in crontab? If it is not me, can that cause some potential problem?
– Tim
Apr 21 '15 at 13:08
when I log out, which user will run and own the job scheduled in crontab? If it is not me, can that cause some potential problem?
– Tim
Apr 21 '15 at 13:08
That depends on which crontab you edited. If you edit the crontab of a user the entries are executed as that user. If you edited the /etc/crontab file the user is often specified between the interval and the command like: "17 * * * * root cd / && run-parts --report /etc/cron.hourly". Besides it does also depend on the platform you are using. Ubuntu uses a different cron than for instance Solaris
– Lambert
Apr 21 '15 at 13:14
That depends on which crontab you edited. If you edit the crontab of a user the entries are executed as that user. If you edited the /etc/crontab file the user is often specified between the interval and the command like: "17 * * * * root cd / && run-parts --report /etc/cron.hourly". Besides it does also depend on the platform you are using. Ubuntu uses a different cron than for instance Solaris
– Lambert
Apr 21 '15 at 13:14
I use ubuntu. What is "the crontab of a user"? In "the crontab of a user", can I also specify which user will run a scheduled job?
– Tim
Apr 21 '15 at 13:26
I use ubuntu. What is "the crontab of a user"? In "the crontab of a user", can I also specify which user will run a scheduled job?
– Tim
Apr 21 '15 at 13:26
Ubuntu cron has some explanation text in the crontab files. As a user perform
crontab -e
to read about the user crontab file and cat /etc/crontab
to read about the server-wide crontab file. From a user crontab file you can not run commands using a different user although it is possible to use sudo if passwordless commands are specified– Lambert
Apr 21 '15 at 13:33
Ubuntu cron has some explanation text in the crontab files. As a user perform
crontab -e
to read about the user crontab file and cat /etc/crontab
to read about the server-wide crontab file. From a user crontab file you can not run commands using a different user although it is possible to use sudo if passwordless commands are specified– Lambert
Apr 21 '15 at 13:33
Thanks.
/etc/crontab
is for system-wide, then where is the crontab file for a user?– Tim
Apr 21 '15 at 19:42
Thanks.
/etc/crontab
is for system-wide, then where is the crontab file for a user?– Tim
Apr 21 '15 at 19:42
|
show 4 more comments
The crontab file for a user is edited by running 'crontab -e'.
New contributor
add a comment |
The crontab file for a user is edited by running 'crontab -e'.
New contributor
add a comment |
The crontab file for a user is edited by running 'crontab -e'.
New contributor
The crontab file for a user is edited by running 'crontab -e'.
New contributor
New contributor
answered 13 mins ago
Brian H.Brian H.
1
1
New contributor
New contributor
add a comment |
add a comment |
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f197615%2fdoes-a-job-scheduled-in-crontab-run-even-when-i-log-out%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