You are not logged in.

#1 2010-05-20 05:42:43

thatnewyorker
Member
From: Brooklyn
Registered: 2009-01-24
Posts: 77

Question about Cron [SOLVED]

For certain reasons I want to automate my system so it does "pacman -Sy" every hour.

I wrote a little bash script as root, used chmod 700 to make it executable and stuck it in /etc/cron.hourly/

This is the script:

#!/bin/sh

exec pacman -Sy


Will this work?

Last edited by thatnewyorker (2010-05-21 02:01:43)


R.I.P In Pieces

Offline

#2 2010-05-20 05:55:25

Vintendo
Member
From: Netherlands
Registered: 2008-04-21
Posts: 375
Website

Re: Question about Cron [SOLVED]

I think so

Offline

#3 2010-05-20 08:28:01

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: Question about Cron [SOLVED]

Yes

Offline

#4 2010-05-20 17:46:53

thatnewyorker
Member
From: Brooklyn
Registered: 2009-01-24
Posts: 77

Re: Question about Cron [SOLVED]

Are you guys sure? It doesn't seem to be working. neutral


R.I.P In Pieces

Offline

#5 2010-05-20 17:58:56

lymphatik
Member
From: Somewhere else
Registered: 2009-03-07
Posts: 119

Re: Question about Cron [SOLVED]

Well you just need to do the following command to understand what pacman is actually doing

man pacman

(Using man will give a lot of information on different functions.)

In your case if you want to update your whole system everyhour you should use sonething like -Syu and as you want it to run in background you should ask him to be quiet. I let you find this option in man ^^

But doing such a thing is quite risky in my opinion, because you might and will miss useful information about package. If you relly want to do this output the stdout of pacman to a file, by using something like this

pacman > test.log

Last edited by lymphatik (2010-05-20 18:01:57)

Offline

#6 2010-05-20 18:31:02

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: Question about Cron [SOLVED]

thatnewyorker wrote:

used chmod 700 to make it executable

Who is the owner of the file?  If is not root, I don't think that will work.

Edit: I re-read your post and I see you created it as root.  You might check that none-the-less

Last edited by ewaller (2010-05-20 18:32:14)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#7 2010-05-20 19:01:20

thatnewyorker
Member
From: Brooklyn
Registered: 2009-01-24
Posts: 77

Re: Question about Cron [SOLVED]

I don't want to automatically update the system, just refresh the package list. I'm using Awesome window manager and have vicious widget that shows me how many updates I have available by using pacman -Qu. I figure its practically useless unless I have pacman -Sy running regularly in the background.

lymphatik wrote:

Well you just need to do the following command to understand what pacman is actually doing

man pacman

(Using man will give a lot of information on different functions.)

In your case if you want to update your whole system everyhour you should use sonething like -Syu and as you want it to run in background you should ask him to be quiet. I let you find this option in man ^^

But doing such a thing is quite risky in my opinion, because you might and will miss useful information about package. If you relly want to do this output the stdout of pacman to a file, by using something like this

pacman > test.log

R.I.P In Pieces

Offline

#8 2010-05-20 22:26:16

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: Question about Cron [SOLVED]

Is the cron daemon running?
Review /var/log/cron.log

Offline

#9 2010-05-21 00:24:27

thatnewyorker
Member
From: Brooklyn
Registered: 2009-01-24
Posts: 77

Re: Question about Cron [SOLVED]

Nevermind guys, I figured it out. Thanks for the concern though:D


R.I.P In Pieces

Offline

#10 2010-05-21 01:40:00

JackH79
Member
From: Australia
Registered: 2009-06-18
Posts: 663
Website

Re: Question about Cron [SOLVED]

@thatnewyorker:
First of all, it would be nice if you could let us know what you did to solve your problem.
Secondly: If your question is answered, please mark your threat as [SOLVED] (just edit your first post).
Thanks.

Anyway, you may also try the following:

-- Pacman widget
pacwidget = widget({ type = "textbox" })
    vicious.register(pacwidget, vicious.widgets.pacman,
    function (widget, args)
        if args[1] == 0 then
            return "<span color='#a2bbff'>Nothing</span>"
        else
            return "<span color='#a2bbff'>" .. args[1] .. " Updates</span>"
        end
    end)

pacwidget:buttons(awful.util.table.join(
    awful.button({ }, 1, function () awful.util.spawn (terminal ..  " -e sudo clyde -Sy" ) end ),
    awful.button({ }, 3, function () awful.util.spawn (terminal ..  " -e sudo clyde -Syu" ) end )
    )
)

pacicon = widget({ type = "imagebox" })
    pacicon.image = image("/home/jack/.config/awesome/icons/pac18.png")
    pacicon:buttons(pacwidget:buttons())

Offline

Board footer

Powered by FluxBB