Tag Info

Hot answers tagged

3

*/15 * * * * . /home/ashish/parser.sh cron uses sh, not bash, so when you source the script (that's what the . does), it is run under sh, not bash. Remove the .. Also, the PATH for cron is limited. Specify the full paths to commands you use, such as workon, or set PATH yourself.


1

Anacron can you what you are asking and is available in the Ubuntu repo's. From the man page: Anacron is used to execute commands periodically, with a frequency specified in days. Unlike cron(8), it does not assume that the machine is running continuously. Hence, it can be used on machines that aren't running 24 hours a day, to control regular jobs as ...


1

KCron & Cron KDE UserBase KCron: https://userbase.kde.org/KCron KCron is a tool for running applications in the background at regular intervals. It's a graphical interface to the Cron command. Ubuntu Community Cron HowTo: https://help.ubuntu.com/community/CronHowto GUI Applications It is possible to run gui applications via cronjobs. ...


1

I suppose that you are using crontab with normal user which means that he can't update/upgrade a system without providing a sudo. Also apt-get update and apt-get upgrade will prompt user for confirmation so you have to pass this confirmation before. yes | apt-get update yes | apt-get upgrade So to solve it you have to run your commands with sudo, but ...


1

Let's start. Create load.sh script nano /path/load.sh #!/bin/bash #we use output from "uptime" i "w" to have load on 5 min UPTIME=`uptime`; W=`w`; RAM=`free -m`; DATE=`date`; sleep 3 DF=`df -h` sleep 3 echo "######################################" >> /var/log/load-result/load_log echo "$DATE" >> /var/log/load-result/load_log echo "" ...


1

When cron doesn't work, it'll send out a mail to the user root. The only problem is: you don't have the software to send / store the mail in mailboxes. But have no fear, Postfix is here! Install Postfix sudo apt-get update sudo apt-get install postfix heirloom-mailx When install postfix, it'll ask you how to you want to setup it up. On the first ...


1

=== Docker alert === If you're using docker, I think it is proper to add that I couldn't manage to make cron to run in the background. To run a cron job inside the container, I used supervisor and ran cron -f, together with the other process. Edit: Another issue - I also didn't manage to get it work when running the container with HOST networking. See ...


1

check following all are correct. (1)-f file.php Parse and execute file */10 * * * * /usr/bin/php -f /var/www/html/register.php (2) give file following permission chmod -x /var/www/register.php (3)check which php $ which php /usr/bin/php if its diffrente then its affect your cron tab. (4)if you are using any url related operation in ...


1

My recommendation would be to put call the script using standard web path, so you don't mingle the users and permissions, e.g. instead of doing: /usr/bin/php <script> rather do: /usr/bin/wget -q http://localhost/test/cron.php Then you need to make sure the script can be called just from localhost (f.e. using Apache2 access policy). This way the ...



Only top voted, non community-wiki answers of a minimum length are eligible