You are not logged in.

#1 2005-03-28 04:21:07

cdk
Member
Registered: 2005-03-21
Posts: 15

cron job help

hya m8s!

so i want to create a cron job that will do the following in order.

1.  run pacman -Syu
2.  run pacman -Scc
3.  run lilo (incase of kernel upgrade)

i want this to run every day at 5am,

the problem is that i know what i want it to do i just have NO idea how to implement it.  i have researched cron jobs a bit but i havent found an easy to understand way exec the above commands.  one of my m8s suggested i use the "at" command but i dont think i can set that to run at a specified time every day.  Please help if you can.

cheers,

  cdk




(note: once ifigure out cron i want to start to try to figure out how to build packages. i have also read the wiki on this and still dont get it)

Offline

#2 2005-03-28 04:27:03

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: cron job help

bad idea. Some things should be done manually (ie monitored).
What you are proposing, is a recipe for disaster, in my opinion.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2005-03-28 04:27:05

smith
Member
From: Crescent City, CA
Registered: 2005-02-19
Posts: 77

Re: cron job help

As root type

crontab -e

Then add entry:

0     5     *     *     *    pacman -Sy

that will execute at 5:00 am every day.

Edit:  cactus is right about updating being a bad idea.  nothing wrong with refreshing package lists though.


I have nothing to say, and I am saying it.

Offline

#4 2005-03-28 04:31:56

cdk
Member
Registered: 2005-03-21
Posts: 15

Re: cron job help

that seems simple enough.  dont know why i had so much problems with it.

why is it a bad thing to do?  seems like it would be a good thing so it keeps the system up to date right?

i figure that if i do it manually or not i still doing the same thing everyday.  any info as to why this would be bad would be great.  i def dont want to mess up my system.

cheers,

cdk



edit:  i was just thinking what if i sent the output to a log file. that way if something messed up then i could see what packages didit and then remove them? just a thought tho.

Offline

#5 2005-03-28 09:56:48

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: cron job help

The main problems are big package changes with nasty side-effects, or non-backward compatible new configs which need to be sorted out manually. Best to run an automatic backup too just before updating everything.

Offline

#6 2005-03-28 12:31:49

T-Dawg
Forum Fellow
From: Wilmington, NC
Registered: 2005-01-29
Posts: 2,734

Re: cron job help

The're right, it is a good idea to keep an eye on what packages are being installed to sort out any problems that may arise from them. pacman still needs confirmation though before it upgrades.....

00 05 * * * konsole --noclose -e sudo -u root pacman -Syu

with that, you will be able to see what your getting before you decide to give it the ok, via konsole. You'll have to get the sudo package and edit the sudoers file in /etc. Uncomment the wheel group and add your self to that group.

Offline

#7 2005-03-28 19:04:26

cdk
Member
Registered: 2005-03-21
Posts: 15

Re: cron job help

k so i see that its a bad idea to set my system to auto update.  so how do i do a back up before i run it.  Is it just a mirrored back up?

cheers,

Offline

#8 2005-03-28 20:51:17

T-Dawg
Forum Fellow
From: Wilmington, NC
Registered: 2005-01-29
Posts: 2,734

Re: cron job help

hdup is a backup tool, arch has it.

Offline

#9 2005-03-29 13:58:08

bauerber
Member
Registered: 2004-12-20
Posts: 40

Re: cron job help

cdk wrote:

why is it a bad thing to do?  seems like it would be a good thing so it keeps the system up to date right?

i figure that if i do it manually or not i still doing the same thing everyday.  any info as to why this would be bad would be great.  i def dont want to mess up my system.

Take KDE 3.3 to KDE 3.4 upgrade as an example:
Your way would have just updated KDE without considering possible side-effects. The recommended way in this case was removal prior to upgrade.
You would not have been able to follow those recommendations if a script would have done the job.
If you really feel the need to auto-upgrade everyday, I'd recommend excluding problematic packages (e.g. kernel. IMO that should only be upgraded with the user watching) and keeping that list up to date by checking with the ARCH news and boards...

greez

bernhard

Offline

Board footer

Powered by FluxBB