Svn update + crontab


#1

I need help to automate svn update through crontab.

Here’s the information I got:

These checkout can be updated (maintaining the branch!) via:
cd /var/www/html/egroupware #or where ever you installed eGW
svn update * # you need the * as subversion will not update the apps otherwise!

What should my script look like ?
Thanks


#2

Does this work?

#!/bin/bash
cd /home/you/where_ever/you/installed/eGW
/full/path/to/be/sure/svn update *

http://wiki.dreamhost.com/index.php/Cron

----------
[color=#00CC00]ANONYMOUS0 => Max Discount[/color], [color=#6600CC]ANONYMOUS2 => Max Discount less $1[/color] or Cut the code, [color=#CC0000]it’s their birthday:[/color] [color=#00CC00]9999 => $99.99 Off[/color]


#3

A bit confused about your solution. Why not :

10 20 * * * /home/.nipto/username/domain.com/egroupware/svn update *

Thx


#4

Was just going with what you posted. If the current working directory needs to be where_ever/you/installed/eGW, then you need to cd there. It’s a matter of where the ‘*’ gets expanded, and I forget where cron starts by default.

[quote]10 20 * * * /home/.nipto/username/domain.com/egroupware/svn update *

[/quote]

Give it a try and see what happens. :cool: But I’d delete .nipto/ since those sometimes change, and it should work (equally well or badly) without it.

----------
[color=#00CC00]ANONYMOUS0 => Max Discount[/color], [color=#6600CC]ANONYMOUS2 => Max Discount less $1[/color] or Cut the code, [color=#CC0000]it’s their birthday:[/color] [color=#00CC00]9999 => $99.99 Off[/color]


#5

Does that mean I should have 2 files ?

one with your code + one for crontab
or
everything in one file ?

Sorry I’m lost


#6

I was serious about testing your cron line. The :cool: was for how cool it is to test things (and sometimes break them).

You can create a script file and run that with a cron command. That’s what I’d try, but YMMV.

You can create your crontab commands using a file (my favorite) or using the online editor (crontab -e).

If you can get it to work with a one-liner command, then all in one file for crontab is good.

----------
[color=#00CC00]ANONYMOUS0 => Max Discount[/color], [color=#6600CC]ANONYMOUS2 => Max Discount less $1[/color] or Cut the code, [color=#CC0000]it’s their birthday:[/color] [color=#00CC00]9999 => $99.99 Off[/color]


#7

Well my question was: How can I have

#!/bin/bash
cd /home/you/where_ever/you/installed/eGW
/full/path/to/be/sure/svn update *

as one cron job ?

and

If I put this as a script called “script.txt”

will the following work ?

10 20 * * * /home/domain.com/script.txt

As you can see, I’m really a beginner. Thanks for your time.


#8

Edit: Yes (no guarantee), but you must also first do: chmod u(plus symbol)x script.txt to make the script executable. (dang forum software deletes the plus)

You can also, if you want, locate the script.txt somewhere else, like in /home/user/bin or something, so it will not be web-accessible.

Edit:

10 20 * * * /home/user/bin/script.txt

----------
[color=#00CC00]ANONYMOUS0 => Max Discount[/color], [color=#6600CC]ANONYMOUS2 => Max Discount less $1[/color] or Cut the code, [color=#CC0000]it’s their birthday:[/color] [color=#00CC00]9999 => $99.99 Off[/color]


#9

OK

In domain.com directory

I wrote a file called “script.script” which contains :

#!/bin/bash
cd /home/domain.com/egroupware
/home/domain/egroupware/svn update *

I wrote another one called “script.cron” which contains

10 20 * * * /home/domain.com/script.script

In SSH :

cd domain.com
crontab script.cron

I was accepted (Will it work at 08:10 pm PST ?)

Is all this right ?


#10

You’ve left out user between home and domain, and be sure to make the script.script executable.

Why not move up the time to a few minutes from now, for a test?

----------
[color=#00CC00]ANONYMOUS0 => Max Discount[/color], [color=#6600CC]ANONYMOUS2 => Max Discount less $1[/color] or Cut the code, [color=#CC0000]it’s their birthday:[/color] [color=#00CC00]9999 => $99.99 Off[/color]


#11

Done

Thanks very much