svn update + crontab

svn update + crontab

Posted by: palladian
Posted on: 2007-02-27 00:51:00

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

Re: svn update + crontab

Posted by: anonymous2
Posted on: 2007-02-27 04:11:00

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

Re: svn update + crontab

Posted by: palladian
Posted on: 2007-02-28 00:15:00

A bit confused about your solution. Why not :

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

Thx

Re: svn update + crontab

Posted by: anonymous2
Posted on: 2007-02-28 00:40:00

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.

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

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.

Re: svn update + crontab

Posted by: palladian
Posted on: 2007-02-28 01:17:00

Does that mean I should have 2 files ?

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

Sorry I'm lost

Re: svn update + crontab

Posted by: anonymous2
Posted on: 2007-02-28 01:25:00

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.

Re: svn update + crontab

Posted by: palladian
Posted on: 2007-02-28 01:49:00

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.


Re: svn update crontab

Posted by: anonymous2
Posted on: 2007-02-28 01:59:00

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:

In reply to:

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


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

----------
ANONYMOUS0 => Max Discount, ANONYMOUS2 => Max Discount less $1 or Cut the code, it's their birthday: 9999 => $99.99 Off
Edited by Anonymous2 on 02/28/07 02:05 AM (server time).

Re: svn update + crontab

Posted by: palladian
Posted on: 2007-02-28 02:04:00

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 ?

Re: svn update + crontab

Posted by: anonymous2
Posted on: 2007-02-28 02:09:00

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?



Re: svn update crontab

Posted by: palladian
Posted on: 2007-02-28 02:17:00

Done

Thanks very much

Tags: svncrontabegroupwaresubversionapps