You are not logged in.

#1 2010-10-05 21:44:16

ftornell
Member
Registered: 2008-08-18
Posts: 277
Website

[Solved] - How to use cronjobs?

Hi,
I would like some input on how I should use cronjobs


I'd like one job (rsync script to mirror a share from another server)
The second for restarting ushare (when restarting ushare it builds up new content that has arrived in MediaLibrary)

Shall I be using crontab -e as root and specify time and path to .sh file (/usr/local/bin/rsync.sh) or shall I put the .sh file inside like cron.daily (will it run at 00:00 am then?)

Am I suppose to use crontab -e manually if I would like some more options and stuff, otherwise I use the folders?

How can I restart a service then? ushare at 02:00 am?

Last edited by ftornell (2010-10-06 06:51:15)


[ logicspot.NET | mempad.org ]
Archlinux x64

Offline

#2 2010-10-05 21:46:47

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: [Solved] - How to use cronjobs?

Offline

#3 2010-10-05 21:51:00

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] - How to use cronjobs?

Offline

#4 2010-10-05 21:52:08

ftornell
Member
Registered: 2008-08-18
Posts: 277
Website

Re: [Solved] - How to use cronjobs?

Read that one but did'nt understand everything.

<minute> <hour> <day_of_month> <month> <day_of_week> <command>
* 1 * * * /etc/rc.d/ushare restart

will that work?


[ logicspot.NET | mempad.org ]
Archlinux x64

Offline

#5 2010-10-05 22:07:17

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: [Solved] - How to use cronjobs?

ftornell wrote:

Read that one but did'nt understand everything.

<minute> <hour> <day_of_month> <month> <day_of_week> <command>
* 1 * * * /etc/rc.d/ushare restart

will that work?

It should. smile What I like to do is simply create shell scripts and place them in /etc/cron.hourly, removing the need for editing crontabs and such.

Offline

#6 2010-10-05 22:23:25

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,538

Re: [Solved] - How to use cronjobs?

Beware though.  There is a longstanding open bug with @hourly and @daily jobs executing multiple times or not at all
https://bugs.archlinux.org/task/18681
Probably safer to explicitly edit the crontab until it is fixed.

Offline

Board footer

Powered by FluxBB