question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

crontab under bos

See original GitHub issue

I have a small script for bos. The script works perfectly under the user bos.

I would like to execute the script for bos via crontab. I have tried crontab -e under root, bitcoin and bos. Crontab does not execute the script for bos for any user.

I also have lnd-charge that I use under the bitcoin user. I also have a script for lnd-charge that I run as bitcoin user in crontab -e without any problems.

It seems to me that the crontab in the user bos is ineffective.

the crontab is: */5 * * * /home/bos/check-process.sh

Unfortunately I don’t have a log to show or I can’t find it. How can I run a script intended for bos with crontab -e?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
AnimaIcommented, Oct 5, 2021

Thank`s Perfect, through your tip I found the solution.

I only changed the file “telegram” to screen -dmS torify /home/bos/.npm-global/bin/bos telegram --connect myKEY-from-TelegramBot

now the crontab runs every 5 min and checks the script if the Telegram service of BOS is running. */5 * * * * /home/bos/start-telegram/check-process.sh >> /home/bos/start-telegram/cronlog.log 2>&1

It would suffice to create a crontab with @reboot sleep 300 && /home/bos/start-telegram/check-process.sh >> /home/bos/start-telegram/cronlog.log 2>&1 2>&1

The script “check-process.sh” checks whether the service has started and restarts if necessary. It’s nice but almost excessive for such a small thing. We do everything to find a solution. 😃

@openoms thank you for your time and your thoughts.

1reaction
openomscommented, Oct 5, 2021

the bos user is not in sudoers so don’t have sudo in any of the scripts running with the bos user.

make sure lines are not commented out in the crontab and use absolute paths like:

30 */4 * * * sudo -u bos /home/bos/.npm-global/bin/bos reconnect

or

*/5 * * * * sudo -u bitcoin /home/bitcoin/.local/bin/charge-lnd -c /home/bitcoin/charge-lnd/charge.config

this applies to the scripts also.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Add Jobs To cron Under Linux or UNIX - nixCraft
You need to use the crontab command to edit/create, install, deinstall or list the cron jobs in Vixie Cron. Each user can have...
Read more >
How cron and at Commands Work - IBM
The cron daemon is responsible for running jobs (processes) at scheduled times, days of the week, or days of the month. Processes that...
Read more >
Vulnerability Details : CVE-2008-5384
crontab in bos.rte.cron in IBM AIX 6.1.0 through 6.1.2 allows local users with aix.system.config.cron authorization to gain privileges by ...
Read more >
How do i activate cron command once within specific time ...
It sets two crons at the moment. One lets say at 1.50 (start time with a command like "play etc") and another set...
Read more >
Server Cron Jobs - Knowledge Base | BuddyBoss Resources
WP-Cron is how WordPress handles scheduling time-based tasks in WordPress. Several WordPress core features, such as checking for updates and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found