FAQ Database Discussion Community


How to monitor the Internet connectivity on two PCs simultaneously?

python,http,cron,connection,monitor
I have two PCs and I want to monitor the Internet connectivity in both of them and make it available in a page as to whether they're currently online and running. How can I do that? I'm thinking of a cron job that gets executed every minute that sends a...

subprocess call to setup crontab

python,cron,raspberry-pi,subprocess
I'm trying to use a subprocess call in python to add a cron job entry: from subprocess import call call(["(crontab -l; echo '* * * * * ls -l | tee tresults.txt') | sort - | uniq - | crontab - "]) And I don't know what I'm doing wrong!...

Rails scheduled task behind a load balancer

ruby-on-rails,amazon-ec2,cron,whenever,whenever-capistrano
I was wondering how to properly schedule a task for a rails application that sits behind an elastic load balancer. This task is an automated weekly email that is to be sent out every Monday from the application. We currently have multiple EC2 instances that sit behind a LB. I...

“tput: No value for $TERM and no -T specified ” error logged by CRON process

linux,shell,unix,ftp,cron
We have a shell script which is run by CRON. The shell script in turn runs a python script which downloads files from an FTP server and then runs a java log processor on those files. The process runs just fine, except that I keep on getting CRON emails even...

source: not found error while running shell script on ubuntu 14.04

django,bash,cron,sh,ubuntu-14.04
OS- Ubuntu 14.04 This is my shell script which i want to schedule using cron job. parser.sh #!/bin/bash source .profile workon venv cd /home/ashish/deployments/myproject export DJANGO_SETTINGS_MODULE=myproject.settings_production python /home/ashish/deployments/myproject/myproject/manage.py parse_data Cron job- */15 * * * * . /home/ashish/parser.sh Whenever this cron job runs i receive a mail with errors: /bin/sh:...

Limit cron from sending a mail for 5 mins in linux/shell

linux,shell,email,cron
I have a shell script that I am running as a cron every minute. My script checks for logs generated in the last one minute and send me a mail if logs generated are more than a certain limit. Now, in times of an issue there could hundreds of files...

WORDPRESS add_filter('cron_schedules', …) not working in a PHP class

php,wordpress,cron
I tried to declare a new time interval for a WP_CRON. When I do it in a PHP file it works. When I do it in a PHP Class it doesn't. Can someone see what I'm doing wrong ? I'm using the plugin cron view to check if the declaration...

Manage whole crontab files in Ansible

cron,ansible
I have a crontab containing around 80 entries on a server. And I would like to manage that crontab using Ansible. Ideally I would copy the server's crontab to my Ansible directory and create an Ansible task to ensure that crontab is set on the server. But the cron module...

Laravel run artisan command every 5 seconds

php,laravel,cron
I am working with a system that sends me webhooks anytime a resource in that system changes. The webhook contains the id of the resource that was updated. For example, if someone edits product ID 1234 in this system, my server will receive an alert saying that product 1234 has...

cannot curl from tcl (eggdrop bot) after restart freebsd/freenas-jail

curl,cron,tcl,eggdrop
I am running a freenas jail environment that run a few eggdrop scripts. One of the scripts at some point executes the command (in tcl): set nfoc [exec curl -m 10 -s -f -k -3 --connect-timeout 3 -L "$url" -o "/tmp/$filename"] So it downloads a file. All was working well...

Execute php in crontab

ubuntu,cron,server
I have a usr/local/bin/test.sh file: #!/bin/bash rm -f /tmp/stat/top-1m.csv.zip wget -P /tmp/stat/ http://s3.amazonaws.com/alexa-static/top-1m.csv.zip rm -f /tmp/stat/top-1m.csv unzip -d /tmp/stat/ /tmp/stat/top-1m.csv.zip php test.php /tmp/stat/top-1m.csv I'm trying to run it on a server, using crontab. Code in/etc/crontab: SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/tmp/stat MAILTO=root HOME=/ 25 12 * * * root /usr/local/bin/test.sh .zipped file gets downloaded...

Check Cron job ran in last 10 minutes

unix,cron
I have multiple scripts running in cron and my cron log is very flooded . I just need to write a unix command to check if one particular scheduled script ran in last 10 minutes .

Creating a cron job with PHP and Apache

php,apache,cron
I have Apache running on Debian with PHP 5.4. PHP-cli is installed. My directory structure for the web project is: - /myproject - /src - /controller - getProviders.php - /model - /public - ClassLoader.php I want to create a cron job to execute getProviders.php every 5 minutes. This is as...

Php schedule run a function after 10 minutes

php,cron,scheduled-tasks,sleep
There is a function A and function B What I would like to do is , after running function A, it start the counting , after 10 minutes it run the function B (for one time only). Notice that during the counting, the function A can be run again ,...

output not reflecting in cronjob

shell,cron
I have a script which send the output of a command. The command takes few seconds to execute. But when I put the command in the cron, the output is not reflected in the mail received nor in the file from where the script fetches the output. echo "$(date)" >...

How to get rid of “Spark assembly has been built with Hive, including Datanucleus jars on classpath” message?

cron,apache-spark
I am running an Apache Spark app as a cron job, but I keep getting emails with the following message Spark assembly has been built with Hive, including Datanucleus jars on classpath message My cron entry is something like the following ...home/sparkJob.sh > /home/SaprkJobOperation-`date +\%Y\%m\%d\%H`-cron.log I understand that there are...

AccessTokenRefreshError: invalid_scope

google-app-engine,cron,oauth-2.0
I am trying to do some things with a Cron.yaml My cron works fine, but the authentication no. In the localhost I use this : from oauth2client.appengine import AppAssertionCredentials storage_credentials = AppAssertionCredentials(scope='https://www.googleapis.com/auth/storage') storage_http = storage_credentials.authorize(httplib2.Http()) storage_service = build("storage", "v1", http=storage_http) This works fine, but when I deploy it in GAE,...

Nested Cron jobs in Nodejs

mysql,node.js,express,cron
I'm having a 'Tournament' sql table that contains start_time and end_time for my tournaments. I also have another table which has playerId and tournamentIds so I can tell which players playes in which tournament. What I'm trying to do is to run a cron task to check my tournament table...

Trying to get cron.php working in Cpanel for Magento

cron,cpanel,cron-task
I have been using this /usr/bin/php -q /home/username/public_html/sub.domain.com/cron.php as my command for the cron job, but I dont get anything. No customer emails, no errors, nothing. When I use php /home/username/public_html/sub.domain.com/cron.php I get the error (Or not error) X-Powered-By: PHP/5.4.37 Content-type: text/html and if I use /home/username/public_html/sub.domain.com/cron.php I get the...

Call a Controller in every 10 Seconds on CodeIgniter [on hold]

php,codeigniter,cron
I made research on site but couldn't find answer, so I decided yo ask this. I'm getting data via XML and this XML renews every 10 seconds. So, I have to re-run my Controller in every 10 seconds. I can not make it via Cron as you know it is...

Does crontab script are detected by ps command?

linux,cron,crontab,ps
Hi everyone, I've got a few scripts running with crontab and I know they are actually running thanks to a log file. The thing is, each time I type ps -ef | grep .sh (because my scripts are .sh files) i have no results. I read that crontab was using...

How to setup a cron job that spans the night and runs every 15mins

cron
How to set up a cron job to run from 2300 hrs to 0515 hrs(next morning) from Sunday to Thursday(job ends on Friday morning) This is a specific requirement since my hostgator server is set to Chicago time and I need a job to run from Monday to Friday Indian...

How to set a cron expression of cron job from controller in Grails

grails,cron,quartz-scheduler
I want to get a cron expression from a user through .gsp and want to set it as new cron expression of Dynamic Job from controller. Intially my cron expression was like "0 1 0 * * ?" but now want to change it to.. say String cronExpression="0 2 0...

Implementing percolate:synced-cron in meteor, in order to a schedule a insert into a collection

javascript,meteor,cron,meteor-collections
It has been recommended to me to use this package synced-cron in order to schedule executions of code. I have the following code which at the time does nothing. My concept is that with this package when a schedule is set up a collection is created and all the data...

How to use cron job on localhost in Windows with Laravel 5

php,batch-file,laravel,cron
I found this post here : Run Cron Job on PHP Script, on localhost in Windows which is working perfectly. Instead of a PHP file I want to run an URL instead, like http://localhost/test-cron-job I tried to simply change this line here: "C:\xampp\php\php.exe" -f "C:\Users\Matthew\Documents\Work\cronjob\my_script.php" to this: "C:\xampp\php\php.exe" -f "http://localhost/test-cron-job"...

NodeJS run code in X minutes architecture

node.js,mongodb,architecture,cron,queue
I want to schedule some code to be run at a variable time. For example, after 60 minutes I want to send an HTTP request to an endpoint and update a database document, but I also want to be able to cancel that code from being ran if an action...

whenever gem not working, Rails 4

ruby-on-rails,ruby,ruby-on-rails-3,cron,whenever
I am using Whenever gem to schedule some work on my site. Currently I am working on development environment. I have instaled gem as guide suggests. In schedule.rb every 2.minutes do rake "vip_recomend:give" end In lib/tasks/vip_recomend.rake namespace :vip_recomend do desc "Give vip recomend to ads that are in waiting list"...

Output of SQL query and command to a file in shell script

bash,shell,unix,cron
I have the following shell script which runs a SQL query and a command which sends the output as an email. The issue is I am able to send only the SQL output. Not the output of the for loop. I tried to give the "EOF" after the for loop...

yii2 cron giving error of “PDO not found”

php,mysql,pdo,cron,yii2
I am running application well in yii2. I created a command controller /commands/TestController <?php namespace app\commands; use app\models\UserProfile; use yii\console\Controller; use app\controllers\AppController; /** * Test controller */ class TestController extends Controller { public function actionIndex() { echo "cron service running"; } public function actionSendBirthdaySms() { $userProfile = UserProfile::find() ->where('MONTH(dob) =...

Run Cronjob (or equivalent) in Rails 4 App for Continuous/repetitve Tasks

ruby-on-rails,ruby,ruby-on-rails-4,cron,cron-task
TASK I want to go through any new records inserted into the database (MySQL) and email them to a personal email address and then mark them as emailed when done. I'd like to do this via a custom written ruby/rails script that is ran via cron (or equivalent). Q What...

OpenShift: Tomcat 7: Cron suddenly stopped working three days ago [duplicate]

cron,openshift
This question is an exact duplicate of: OPENSHIFT Cron job just stop working 2 answers I had one script running under the .openshift/cron/daily like a clockwork, but suddenly, three days ago, it stopped working, without my intervention. I created a simple script with a "echo Hello" under the .openshift/cron/minutely,...

Magento CE 1.9.1.1 not sending sales emails

php,email,magento,cron
We are having issues with Magento not sending emails out. The emails having issues are the sales email which are logged into core_email_queue. None of these are sending. All other emails send fine through my server. I am aware that CE1.9.x send emails through cron and my cron.php is running...

How to setup cron job to run every 5 days?

arrays,cron
I want to setup cronjob which will start on for example today and it will run every 5 days. This is what I have now, is this will work correctly ? If I install this job at 5 o`clock and then every 5 days on 6 AM. 0 6 */5...

Laravel 5 schedule not work

php,laravel,cron,laravel-5
My laravel version is 5.0.28, I build on cloud9, I had add this command on my cron #!/bin/bash PATH=/usr/bin * * * * * php /home/ubuntu/workspace/app/artisan scheduled:run 1>> /dev/null 2>&1 And I add this code on my Kernel.php. I ref this sit https://laravel-news.com/2014/11/laravel-5-scheduler/ <?php namespace App\Console; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel...

What's the best way of scheduling a task that runs over ten minutes in Google App Engine?

python,google-app-engine,cron
Let's say I have a script that runs for an hour. All it does is sleep for an hour and change something in the Datastore at the end of the hour. def task(keyname): time.sleep(3600) q = Item.all() item = q.filter("keyname = ", "%s" % keyname).get() item.value += 1 item.put() What...

Laravel setup, trying to have cronjob call a function within php laravel file

php,laravel,laravel-4,cron,laravel-5
Original Post Good evening folks. I have a laravel setup and I'm trying to have a cronjob execute a php function to a file within the laravel project directory. I am getting class and name space errors when I try to do something like this: <?php require_once('../laravel/app/Http/Controllers/NotificationsController.php'); and then calling...

Destroy all issue

ruby-on-rails,ruby,cron
I have a standard has_many/belongs_to relationship with movies and posters. Each movie can have many posters. I have the following in a rake command: task remove_movie_posters: :environment do destroyed = Movie.where(fake: true).posters.where("created_at < ?", 1.minute.ago).destroy_all puts "Done. " + destroyed.length + " records deleted." end but I get the error:...

Does cron job block the main process or nodejs will create a worker to do cron task

node.js,process,cron,backgroundworker,cron-task
I am using node-cron to do some heavy tasks (update database) every minute. Does this task use main process to work or nodejs will create some workers to do these taks? var CronJob = require('cron').CronJob; new CronJob('0 * * * * *', function() { //Update database every minute here console.log('Update...

Magento invalid cron expression

magento,cron
One of the extensions I have installed in Magento has a cron scheduled with the expression 0 0 4 1/1 * ? *. From what I've gathered means it should run every day at 4am. When the Magento cron runs I get an error report saying: Invalid cron expression: 0...

Google App Engine, Web2Py, and Cron, unable to assign value to attribute for url error

python,google-app-engine,cron,web2py
I'm having some trouble creating a Google App Engine Cron task for my Web2Py application. I've looked at the instructions for GAE Cron, and this is the task I created as a test: my cron.yaml file is in the same directory as my app.yaml, the path to my python controller...

Gemfile not found using Cron job with Capistrano 3 and whenever gem

ruby-on-rails,cron,capistrano3,whenever
Cron Job Working Fine on my pc. But when i deploy it to the server using capistrano. The cron.log file show that it is looking for that release which is not present on server how can i resolve this problem. any idea...? /home/deployer/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/bundler-1.7.2/lib/bundler/definition.rb:22:in `build': /home/deployer/apps/production_app/releases/20140906112257/Gemfile not found (Bundler::GemfileNotFound) from When...

Jenkins - Build job monthly or weekly

syntax,jenkins,cron
What is the cron syntax for scheduling a Jenkins job: a) monthly b) weekly Thanks!...

Shell script to check if mysql is up or down

mysql,shell,cron
I want a bash shell script that i can run using a cron job to check if mysql on a remote server is running. If it is, then do nothing, other start the server. The cronjob will be checking the remote server for a live (or not) mysql every minute....

PHP: path is incorrect while running script from cron

php,linux,cron,include,filesystems
I'm having a strange problem. When I call script with http request (from browser) it works as it should. But when I'm calling it with cron include starts complaining on paths. Why can paths be ok while running the script in a common way an incorrect in cron? I've tried...

Efficient way of exporting a bunch of PDF's from a user?

php,pdf,cron,wkhtmltopdf
I need to give our users the ability to export a bunch of their PDF's (invoices).The problem is, the PDF's are generated everytime a user opens them. So I don't have them already stored in a filesystem. So, my question is, what would be an efficient way of exporting a...

Quartz | Cron expression not working as expected

java,cron,quartz-scheduler,cronexpression
I'm trying to build up a cron expression that will trigger in every minute starting from a given hourly range. My expression would be: 0 0/1 12/10-14 * 1-5 ? I'm expecting this to work as, starting from 12.04 AM to 02.00PM trigger at every minute. But when I start...

how can I close function for others except cornjobs in php?

php,cron
I have a function in a php file that a cornjob run it every hours... but If someone or another robots run it my result gone break. how can I close function for others except cornjobs? something like this: if(if is my server cornjobs) { dofunction(); } else echo 'not...

Difference between * and ? in Spring @Scheduled(cron=“…”)

java,spring,cron,scheduled-tasks,scheduler
I've been looking at the Spring Boot example for scheduling tasks (https://spring.io/guides/gs/scheduling-tasks/) and reading through some documentation (https://javahunter.wordpress.com/2011/05/05/cronscheduler-in-spring/) and I see that * and ? are used almost interchangeably. For example, the line @Scheduled(cron = "0 15 10 ? * *") and @Scheduled(cron = "0 15 10 * * ?")...

Authorization issue with cron crawler inserting data into Google spreadsheet using Google API in Ruby

ruby,cron,google-api,web-crawler,google-api-client
My project is to crawl the certain web data and put them into my Google spreadsheet every morning 9:00. And it has to get the authorization to read & write something. That's why the code below is located at the top. # Google API CLIENT_ID = blah blah CLIENT_SECRET =...

How to schedule an R Script Cronjob in a linux server? [closed]

linux,r,cron,crontab
I am trying to schedule a cronjob to execute an R Script in a linux server. I have achieved to type the commands in the server manually and it works. To do so i have to type the following commands: [email protected]:~# cd /home/script2 [email protected]:/home/script2# Rscript scriptSecos.R How can i specify...

GPG in a cron script

cron,gnupg
I'm trying to encrypt symmetrically (with gpg) a file from a cron job. The line in my script doing this is : c/usr/bin/gpg --no-tty -vv --exit-on-status-write-error --batch --passphrase-file /home/backup/full/pass --cipher-algo AES256 --symmetric fullbackup.tar.bz2 > error.log 2>&1 It's working well when I execute the script from prompt, but not from crontab....

Using cron and ruby

ruby,cron,rubygems
OS: Mac OS X 10.10.3; Ruby version: 2.2.0; I have a problem with using cron, that launches ruby script. Problem: cron launches ruby script, but nothing happened. That cron says in its logs (script requires mongo gem) : /Users/username/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- mongo (LoadError) from /Users/username/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'...

User Created Job Scheduling

node.js,meteor,cron
I'm currently in the process of building an app in MeteorJS that allows users to create jobs and schedule them, e.g. Posting a link to social media every 2 hours. Are there any Meteor or Node packages that would make this possible? I've looked into https://github.com/percolatestudio/meteor-synced-cron, but I'm not sure...

How to stop minute cron job?

linux,ubuntu,cron
I have a program written in python,my program scrapes a value from some financial website every minute and pushes that value into my DB.My program takes like 1 or maximum 1.5 seconds to do this job. I have set a cron job to call my program every minute. I need...

How to check if whenever gem is working?

ruby-on-rails,ruby,cron,whenever
I've got the following configuration. I've installed whenever gem, created shedule.rb: # Learn more: http://github.com/javan/whenever every 6.hours do runner "Part.check_status_update" end In part.rb model I have corresponding method. A. How can I check if whenever runs? As I understand it should only modify the crontab after whenever command in the...

Run a Jenkins job every one minute using H/1 * * * *

jenkins,build,cron,job-scheduling,periodic-processing
How can I run a job created in Jenkins every one minute ? Am I missing anything? PS: I'm trying not to use: */1 * * * * ...

wp_schedule_event hook sheduled but not working

php,wordpress,cron,wordpress-plugin,cron-task
I'm trying to trigger cron job from WordPress Plugin that I'm writing (It's gonna take all new Products and export them to CSV every day) so the problem is that when I'm put this code in functions.php all working great and the code is valid but from the plugin folder...

Using docker-compose (formerly fig) to link a cron image

ruby-on-rails,cron,docker,fig,docker-compose
I'm runing a simple rails app in docker using docker-compose (formerly fig) like this: docker-compose.yml db: image: postgres volumes: - pgdata:/var/lib/postgresql/data web: build: . command: bundle exec rails s -b 0.0.0.0 volumes: - .:/usr/src/app ports: - "3011:3000" links: - db Dockerfile FROM rails:onbuild I need to run some periodical maintainance...

Prevent parallel execution using a table lock (MySQL)

php,mysql,cron,table-locking,table-lock
I have a MySQL table called cronjobs which holds entires for every cronjob needed (e.g. delete old emails, update profile age, and so on). For every cronjob there is a defined code block which gets executed if the cronjob is due (I got different intervals for different cronjobs). For the...

Cron job at specific interval of minutes

cron,crontab,ubuntu-14.04
I need to run a cron job in linux at 20 minutes interval everyday. The most important thing is, it must be on specifically 10th, 30th and 50th minutes. I think I need to run 3 cron jobs as : 10 * * * * /path_to_script 30 * * *...

Renew Facebook Access token via cron

php,facebook,cron
I'm writing a cron script which, periodically posts to facebook. How would I go about renewing the access token each time the script runs?...

Bash script failing when run by cron - mktemp outputting nothing

bash,cron
I have a shell script, that works when I run it manually, but silently fails when run via cron. I've trimmed it down to a very minimal example: #!/usr/bin/env bash echo "HERE:" echo $(mktemp tmp.XXXXXXXXXX) If I run that from the command line, it outputs HERE: and a new temporary...

Cron expression must consist of 6 fields (found 1 in “#{systemEnvironment['db_cron']}”)

spring,groovy,cron,spring-el
I'm trying to set a cron Scheduled annotation as follows: @Scheduled(cron = "#{systemEnvironment['db_cron']}") def void schedule() { } Next set the environment variable as: export db_cron="0 19 21 * * *" However, I get the runtime error: Cron expression must consist of 6 fields (found 1 in "#{systemEnvironment['db_cron']}") What can...

Run a cron job that performs other cron jobs schedules in MYSQL

php,mysql,cron
My system runs some intensive cron jobs twice daily. These are lengthy scripts. Occasionally, an action is performed in my system that requires the cron job to run on demand. My idea is to create a master cron job that checks my database for a table of scheduled events and...

linux cron truncate large file

linux,bash,csv,cron
I have a large csv file that I need to reduce to the last 1000 lines through a cron job every day. Can anyone suggest how to accomplish this? What I have so far are two commands but do not know how to combine them For deleting lines from the...

catalog price rules disappear after mid night in magento site

magento,cron
we have a problem with catalog price rules in 1.9.0 we have some 1000 products in a site. we applied catalog price rules to give discount for 500 products. i did't gave any date limit for catalog price rules those special prices are displaying only until mid night. next day,...

EB Worker cron.yaml - is not authorized to perform: dynamodb:UpdateItem

amazon-web-services,cron,elastic-beanstalk
I have been trying to implement a cron job on my EB worker. My EB CLI on a deploy says "ERROR: Update environment operation is complete, but with errors." My yaml seems to parse just fine and in my EB events list I see the line "Successfully loaded 1 scheduled...

Trying to schedule first cron job, does this schedule look good

cron,crontab
I'm trying to schedule my first cron job: * 0830 * * 1,3,5,0 ls -l I'm expecting the job to run Mon, Wed, Fri, and Sun at 8:30am...

Run simple Java class file with crontab

java,ubuntu,cron,crontab
I'm trying to run a simple java helloworld program with crontab. I made the following java code: helloworld.java: class HelloWorld { public static void main (String args[]) { System.out.println("Hello world"); } } I then try to run this from a crontab in the following sequence: crontab -e At the end...

Is it acceptable to fork a PHP script to continue email processing and to return data to the user?

php,cron,swiftmailer
I'm adding email functionality to an existing website and I am trying to integrate it in a way that requires the least user wait time. My latest plan is to fork a user's request when the application gets to sending the actual email so I can return a page the...

Mongodb colelction find in cron job throws new Error('Can\'t wait without a fiber');

node.js,mongodb,meteor,cron,fiber
I have set up a cron job using the npm package cron. I am trying to do the following Coll.find().forEach function but I am getting the error Error: Can't wait without a fiber var job = new CronJob({ cronTime: '00 09 11 * * 1-5', onTick: function() { var userIds...

How to call posts from PHP

php,wordpress,caching,cron,call
I have a website, that uses WP Super Cache plugin. I need to recycle cache once a day and then I need to call 5 posts (URL adresses) so WP Super Cache put these posts into cache again (caching is quite time consuming so I'd like to have it precached...

Why Angular-cron-jobs generates the same cron expression for “Every Minute”, “Every Hour at 0 past hour”,“Every Day at 0:0” etc

angularjs,cron,cronexpression
As the question has suggested, if you play around with DEMO BASIC at http://jacobscarter.github.io/angular-cron-jobs/#/ you will see that "Every Minute", "Every Hour at 0 past hour","Every Day at 0:0","Every Week on at 0:0" all generates the same expression: ***** The same problematic thing happens when you select Every Year, no...

Facebook server side oauth token

php,facebook,cron,facebook-sdk-4.0
I'm updating a cron script made with the previous version of the php sdk for facebook (3.2.2). They way it was implemented it was using a fixed access token. My question is, is there a way to generate it on the server without asking the user to login? (since this...

Scheduling scripts with variable frequency

linux,shell,cron,server
I want to run a python script on a ubuntu 14.04 server with following frequency: Monday to Friday: From 0800 hrs to 1600 hrs: Run once every hour From 1600 hrs to 2300 hrs: Run once every 30 minutes Saturday and Sunday: From 0800 hrs to 2300 hrs: Run once...

Amazon EC2 - Quartz and Job not running at correct time

java,amazon-web-services,amazon-ec2,cron,quartz-scheduler
I have a java app deployed on an Amazon EC2 server. I use quartz for scheduling various jobs. I tried scheduling a job to run at 9am - I noticed it didnt execute until 10am I then tried to execute a job at 9am GMT-5 -should of executed at 2pm...

What is the cron definition for each minute for a job in grails?

grails,cron,quartz-scheduler,jobs
I'm using Quartz plugin for Grails for a synchronized job minute by minute, but I'm unable to use the 0 * * * * * definition and is throwing some exception: Error loading plugin manager: Unable to locate constructor with Class parameter for class grails.plugins.quartz.DefaultGrailsJobClass (NOTE: Stack trace has been...

Updating page info using jQuery from a PHP script that performs an external connection

php,jquery,cron
I have a PHP script that performs a connection to my other server using file_get_contents, and then retrieves and displays the data. //authorize connection to the ext. server $xml_data=file_get_contents("http://server.com/connectioncounts"); $doc = new DOMDocument(); $doc->loadXML($xml_data); //variables to check for name / connection count $wmsast = $doc->getElementsByTagName('Name'); $wmsasct = $wmsast->length; //start the...

Spring scheduling task - run only once

java,spring,cron,scheduled-tasks
Is it possible to schedule Spring service method only once at exactly specified time? For example, current time is 2pm but when I hit the action button I want that my service method starts at 8pm. I'm familiar with @Scheduled annotation and I'm not sure how to write cron expression...

Meteor: copy document to another collection and delete from original collection after 'expirationDate'

node.js,mongodb,meteor,cron
I am looking for an efficient way to publish blog posts if the expirationDate (which is a field in the blog document) has not passed the the current date. The following is a simple working solution but please read below what I am aiming to do. Meteor.publish('nonExpiredBlogs', function() { var...

async job scheduling in nodejs using loop

node.js,asynchronous,cron
I have a JSON of tasks grouped in the interval (see unit) they are supposed to be repeated by every interval of unit. items=[ { "unit" : "minute", "detail" : [ {"every" : 3, task : "task1"} {"every" : 4, task : "task2"}... ] }, { "unit" : "day", "detail"...

php function to check when an uploaded image has been in the directory for longer than a day

php,file-upload,controller,cron,unlink
I have a cron controller class that basically handles all cron job related work. I'm trying to add a function to the controller that deletes images that have been in the directory longer than a day. Here is what I have so far, and it makes sense to me I...

How do I run a specific shell script in a cron job?

oracle,csv,cron,crontab,cron-task
I have set up a cron job which will run a shell script to connect to our Oracle database and copy a table as a csv file. crontab -l outputs: */5 * * * * /home/user/import.sh > /home/user/importLog.txt import.sh looks like this: #!/bin/bash FILE="/path/to/application/TABLE.csv" sqlplus -s [email protected] <<EOF SET PAGESIZE...

CodeIgniter CronJob returning default view

php,codeigniter,cron
I'm having a really weird problem executing a CodeIgniter CronJob. When i execute the task from the command line using "php /path_to_ci/index.php conjob" everything works as expected. But, when i add the same command to the crontab, the command returns the default view. Does anyone knows what could be the...

Rails: Model method doesn't execute as a cron task in development

ruby-on-rails,ruby,cron,youtube-api,whenever
I am currently writing an application in Ruby on Rails that fetches data (videoId as a string, title as a string, thumbnail url as a string, and date of when video was created as a datetime type) from YouTube and saves it to the database. I have tested YouTube API...

Run a command with sudo in bash shell

shell,cron,sudo
How can i run a command in shell script with sudo? This script will be run by a cron job, so there should be no human intervention to enter a password manually.

rmdir/unlink not working through cron

php,cron,cpanel
I wrote a cron job that will delete folders (and files inside of it) with dates older than today - 14 days using DateTime. On my server, if I browse to the file (cleanup.php) in my web browser, it deletes the folders and files fine. The cron job runs because...

Run Cron PHP script Every Minute Except 5 Minutes Out Of Day

php,sql,cron
Is this possible? Right now I have my cron running a php script every minute of every day, works good. But 5 minutes out of the day (at least) I want to allocate to downtime to truncate the sql table associated with it and do other routine maintenance. Thanks....

Cron job with CodeIgniter using wget

php,codeigniter,cron,crontab,wget
I am pretty new to setting up cron jobs. What I've done so far is set one up to run every 5 minutes using the following script: */5 * * * * wget -q localhost:8888/example/index.php/controller/function When I run just the wget part from the command line, it works perfectly. But...

How do you implement a cron job logic in web applications? [closed]

php,linux,web-services,cron
In our web application, we need to implement a business logic like: An order's status will be changed from "Submitted" to "Expired" after two weeks, if the seller does not take any action. We are using php5+apache+mysql+linux. To implement this logic, we need something like a linux crontab task that...

Showcase website that will reinstall itself every day?

magento,cron,cron-task
I have built a showcase Magento installation that I am about to deploy public. I'd like to give people backend access but indeed I don't want their changes to stick - not sure how to go about this. What's the best way? I have seen a Magento showcase somewhere that...

Basic cron job issue

javascript,html,insert,cron,jobs
I have a particular script in my HTML file that I want to run every 24 hours using a cron job. My question is what path do I enter into my hostinger (host) command. Do I enter php /path/to/index.php because won't that run my whole code every 24 hours, I...

How to run a script in nodeserver every hour?

node.js,cron,meanjs
I have a mean.js project, with this structure in the app (where the server files are): -app --controllers --models --docs --logs --routes --tests --views bower.json Gruntfile.js package.json README.md I want to do a "cron job" every hour or so on my mongodb. I ran into this: https://github.com/scripting/noderunner Where should i...

Setup Auto-Login/Visit Specific URL? [closed]

php,html,unix,cron,automation
There is a website where I want to be logged in always to be seen 7/24 online, because there is a queue among users and you go forward more on this queue if you are more often online. I have a linux server which I am planning to use for...

How do I write this Cron Expression?

grails,cron,quartz-scheduler
I am trying to write a cron expression for a job which should run every 3 days at 9AM GMT. This is what I am writing "0 0 9/72 ? * ?" But I get it's as an invalid cron expression because I suppose there can not be two question...

Running bash script as Cron job with R Markdown

linux,r,bash,cron
I want to try how to render html from R markdown file but from a bash script running as Cron jobs. I don't know why everything works fine, except running as Cron jobs. What I do: My script is a demo script from Rstudio --- title: "test" author: "sms" date:...

Python: How to handle 'crontab' command?

python,linux,ubuntu,cron,crontab
We know the crontab command is used for scheduled tasks in Linux. I want to write a Python script. Its function is to receive some data (these data are related to crontab setting) and execute a 'crontab' command in order to reset the content of the user's crontab file. I...

s3cmd not working as cron-task when echos/dates are added

amazon-web-services,amazon-s3,cron,cron-task,s3cmd
I have a Digital Ocean Droplet (VPS) running Ubuntu 14.04. I have installed s3cmd and am able to run a sync successfully with this command: s3cmd sync --recursive --preserve /srv s3://MY-BUCKET-NAME And if I put that same command in to a .sh to run as a cron-task every minute, it...

Cronjob: Python script not writing to file

python,cron,raspbian
I'm working on raspbian and wrote a python script which communicates via RS232 with some hardware relatet to pysical IO States of the Raspberry. It also writes to a logfile. Everything works fine when I start the script from command line: [email protected] ~/scripts $ python steppercontrol.py I added the scrip...

How to run cron scheduler only once?

cron
My scheduler looks like this: @Scheduled(cron = "* 30 11 * * *") That's nice. Every 11:30 it runs! works great! but if the scheduler will finish working on 11:30:10, scheduler runs again. How can I add seconds here? Is it true? @Scheduled(cron = "0 30 11 * * *")...