cron-task

Cronjob with password protected site (.htaccess)

不问归期 提交于 2019-12-04 04:03:50
I want to create a cronjob that every X time goes to open a webpage. This webpage is password protected by .htaccess (user=admin, passwor=pass). The instruction I give is the following: wget --user=admin --password='pass' http://www.mywebsite.com/test.php But cron gives me the following error: --2012-05-02 10:14:01-- http://www.mywebsite.com/test.php Resolving www.mywebsite.com... IP Connecting to www.mywebsite.com|IP|:80... connected. HTTP request sent, awaiting response... 401 Authorization Required Reusing existing connection to www.mywebsite.com:80. HTTP request sent, awaiting response...

Constantly monitor a program/process using Python

与世无争的帅哥 提交于 2019-12-03 12:59:18
I am trying to constantly monitor a process which is basically a Python program. If the program stops, then I have to start the program again. I am using another Python program to do so. For example, say I have to constantly run a process called run_constantly.py . I initially run this program manually, which writes its process ID to the file "PID" (in the location out/PROCESSID/PID). Now I run another program which has the following code to monitor the program run_constantly.py from a Linux environment: def Monitor_Periodic_Process(): TIMER_RUNIN = 1800 foo = imp.load_source("Run_Module","run

Setting Cron job to delete file after 24 hours

爱⌒轻易说出口 提交于 2019-12-03 08:34:12
I read all the related questions and was unable to understand them. I am using Plesk CPanel to set cron job as it was advised by everyone. I want to delete all files from a folder after 24 hours. Assume that I have to delete it after every 2 mins (So I can check its working or not). I have two options: Either run a PHP file that deletes all files after 24 hours using a cron job Use the cron job command `rm` to delete all the files I tried both ways and was unable to get my task completed. Here is the pic of cpanel scheduled task: http://i41.tinypic.com/2n0tsfs.png I want to delete files from

logrotate cron job not rotating certain logs

做~自己de王妃 提交于 2019-12-03 02:10:00
I added two scripts in "logrotate.d" directory for my application logs to be rotated. This is the config for one of them: <myLogFilePath> { compress copytruncate delaycompress dateext missingok notifempty daily rotate 30 } There is a "logrotate" script in "cron.daily" directory (which seems to be running daily as per cron logs): #!/bin/sh echo "logrotate_test" >>/tmp/logrotate_test #/usr/sbin/logrotate /etc/logrotate.conf >/dev/null 2>&1 /usr/sbin/logrotate -v /etc/logrotate.conf &>>/root/logrotate_error EXITVALUE=$? if [ $EXITVALUE != 0 ]; then /usr/bin/logger -t logrotate "ALERT exited

How to run a cron job at every 5 hour interval

半世苍凉 提交于 2019-12-02 08:31:24
How to run a Cron job at every 5 hour interval? I've tried this 0 */5 * * * /path/to/script/script.sh (Not necessarily a shell script) But the problem with this expression is it'll run every 5 hour but the clock will reset at midnight 00:00:00 everyday. Explanation: if the job executes at midnight 00:00:00 then following will be the execution timing 00:00:00, 05:00:00, 10:00:00, 15:00:00, 20:00:00 after 20:00:00 the job will execute at 00:00:00 which is 1 hour earlier than specified. But my requirement is the job should run at 5 hour interval and shouldn't get reset at midnight So if the job

Cron Job Doesn't Run

妖精的绣舞 提交于 2019-12-01 07:03:37
I am new to using crontab, and I've been trying to get a simple cron job working. The code for the cron job is as follows: */1 * * * * echo "job every minute" So just for proof-of-concept, I want to see this printed every minute. I have tried saving this cron job using both sudo crontab -e and by saving a crontab file (cronscript) in a directory and enabling the script as follows: crontab ~/Documents/MyProjects/cronscript which is the path for where the cron job is located. Both of the identical jobs are saved properly, as I have verified by typing sudo crontab -e and crontab -e into terminal

Whenever cron job is not working in rails 3

空扰寡人 提交于 2019-12-01 06:12:27
This is the code in my schedule file. I am using 1 min just to test whether its working or not. every 1.minutes do runner "User.update_all('daily_sms_count' = 0 )" end from terminal i setup whenever --set environment=development --update-crontab 1mintesting Whats the issue? Are you using RVM? If so, Whenever generates a crontab entry like this: * * * * * /bin/bash -l -c 'cd /Users/myuser/Documents/Projects/foo && script/rails runner -e development '\''User.update_all("daily_sms_count" = 0 )'\''' This means that it won't necessarily be using your project's version of Ruby and associated gemset

Whenever cron job is not working in rails 3

▼魔方 西西 提交于 2019-12-01 05:54:58
问题 This is the code in my schedule file. I am using 1 min just to test whether its working or not. every 1.minutes do runner "User.update_all('daily_sms_count' = 0 )" end from terminal i setup whenever --set environment=development --update-crontab 1mintesting Whats the issue? 回答1: Are you using RVM? If so, Whenever generates a crontab entry like this: * * * * * /bin/bash -l -c 'cd /Users/myuser/Documents/Projects/foo && script/rails runner -e development '\''User.update_all("daily_sms_count" =

Cron Job Doesn't Run

China☆狼群 提交于 2019-12-01 04:37:14
问题 I am new to using crontab, and I've been trying to get a simple cron job working. The code for the cron job is as follows: */1 * * * * echo "job every minute" So just for proof-of-concept, I want to see this printed every minute. I have tried saving this cron job using both sudo crontab -e and by saving a crontab file (cronscript) in a directory and enabling the script as follows: crontab ~/Documents/MyProjects/cronscript which is the path for where the cron job is located. Both of the

Scheduled job executes multiple time in Evernote- AndroidJob

好久不见. 提交于 2019-11-30 15:08:40
问题 I have one periodic job I want to run and it is implemented with the help of Evernote's Android Job library. What I wish to achieve is to updateMyLocation ever 15 mins. The problem is that every 15 mins, the job seems to be executing multiple times. I tested using a OnePlus3 device and from debugging, I observed that the LocationUpdateJob.schedule() is called only once, which is correct, but the LocationUpdateJob.onRunJob() gets called multiple times, which is incorrect, but should only be