Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Daily cron at specific time

Tags:

openshift

I would like to run a daily job at the OpenShift Express PaaS. I know how to activate the cron cartridge on my app and how to add scripts into the correct cron folder.

But I have a special need to specify, at which time of the day the job will be executed. E.g. "Every day at 10:30pm"

Is this possible with the OpenShift cron cartridge? How do I configure a daily job with a specific time?

Regards, Lars

like image 600
reschifl Avatar asked May 04 '12 12:05

reschifl


1 Answers

You can use the "minutely" cron job and only run your script if the current time is 10:30pm.

Like this :

#!/bin/bash

if [ `date +%H:%M` == "22:30" ]
then
    bash scriptToRunAt10h30pm.sh
fi
like image 102
bbigras Avatar answered Nov 08 '22 06:11

bbigras