Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Automated script to run zypper dup periodically

  1. #1
    Marco NNTP User

    Default Automated script to run zypper dup periodically

    Hello everyone

    I recently updated my girlfriends laptop (and my own) to KDE 4.4 (using
    the Factory repository). I am also using some additional repositories
    like PackMan.

    I recently read on this forum, that the updater-applet is only updating
    from the main repositories (the ones set up after install). I would like
    to update from all updates periodically using "zypper dup".

    I read somewhere else, that cronjobs are used to run scripts based on
    schedules. Can someone eyplain to me how I could run "zypper dup" with a
    cronjob and preferably under root, so I dont have to type the password
    every time?

    Thanks

  2. #2
    Join Date
    Jan 2009
    Location
    43.009 N, 73.172 W
    Posts
    189

    Default Re: Automated script to run zypper dup periodically

    Become root

    Code:
    su -
    Edit the crontab

    Code:
    crontab -e
    Enter the command

    Code:
    05 02 * * * "/usr/bin/zypper dup"
    That will run zypper at five minutes past 2am every day of the week. You may need to remove the quotes around the command. I didn't test it.

    Save the crontab, if using Vi do: Shift colon wq

    Code:
    :wq
    Exit as root.

    If you want to run less frequently read the man page for crontab(5)

    Code:
    man 5 crontab

  3. #3
    Marco NNTP User

    Default Re: Automated script to run zypper dup periodically

    Thanks a lot. According to the manpage the quotes had to be removed.

    Am 14.03.2010 18:16, schrieb udaman:
    >
    > Become root
    >
    >
    > Code:
    > --------------------
    > su -
    > --------------------
    >
    >
    > Edit the crontab
    >
    >
    > Code:
    > --------------------
    > crontab -e
    > --------------------
    >
    >
    > Enter the command
    >
    >
    > Code:
    > --------------------
    > 05 02 * * * "/usr/bin/zypper dup"
    > --------------------
    >
    >
    > That will run zypper at five minutes past 2am every day of the week.
    > You may need to remove the quotes around the command. I didn't test
    > it.
    >
    > Save the crontab, if using Vi do: Shift colon wq
    >
    >
    > Code:
    > --------------------
    > :wq
    > --------------------
    >
    >
    > Exit as root.
    >
    > If you want to run less frequently read the man page for crontab(5)
    >
    >
    > Code:
    > --------------------
    > man 5 crontab
    > --------------------
    >
    >



  4. #4

    Default Re: Automated script to run zypper dup periodically

    Running unattended "zypper dup" is one of the _worst_ ideas I ever saw in a forum.

    OTOH, running it the way described above will not harm the system, on the contrary, it will save the system from any updates (attended or unattended) from -let's guess- 2:06 am on.

    Why it's a bad idea and why it will block any updates after running that cron can be found when reading "man zypper".

  5. #5
    Join Date
    Jan 2009
    Location
    43.009 N, 73.172 W
    Posts
    189

    Default Re: Automated script to run zypper dup periodically

    Live and learn.

  6. #6

    Default Re: Automated script to run zypper dup periodically

    Quote Originally Posted by Akoellh View Post
    Running unattended "zypper dup" is one of the _worst_ ideas I ever saw in a forum.

    OTOH, running it the way described above will not harm the system, on the contrary, it will save the system from any updates (attended or unattended) from -let's guess- 2:06 am on.

    Why it's a bad idea and why it will block any updates after running that cron can be found when reading "man zypper".
    Thanks for your thoughts. I will look into the manpage once I am back on Linux. In the meanwhile, what is so bad when the updates are only applied once a day? I understand the point that it might block updates that come in later that day but this shouldnt be a big problem (most update tools work like that...meaning they run once a day). Or am I completely misunderstanding something here?

    Thanks

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,972

    Default Re: Automated script to run zypper dup periodically

    You may want have security updates automaticaly installed. That can perfectly be configured using YaST. So why to make a cron job yourself?
    Some peoplw will never do this, but in your case (a friend where you are not always in the neighbourhood to do this manualy) I would say: "why not?"


    But you asked something very different, you wanted to do a zypper dup what is inappropriate except when you want to go to 11.3 somewhere in the future and I do not think you will let that happen unattended? That is causing the outcry. But you promised allready to go for the man page, so maybe you come back later with questions about that.

    Even a zypper up is not a thing most people want to do automaticaly and unattended. Also there is only use for it when you have others then the standard OSS and non-OSS repos. When you have Packman and say KDE:Stable, I can see some use for it. But I wouldn't do this more often then say once a week.

    In short one should try to calculate the priorty of the updates (security first) against the basicaly three ways to update/upgrade.
    Henk van Velden

  8. #8
    Join Date
    Jan 2009
    Location
    43.009 N, 73.172 W
    Posts
    189

    Default Re: Automated script to run zypper dup periodically

    I did many many unattended updates with RedHat. I know many others that did auto updates too. I don't see why OS is any different? It would be much easier for users to get their updates without interaction, you know like Microsoft does. A bit more user friendly.

  9. #9
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,818

    Default Re: Automated script to run zypper dup periodically

    What he is doing is syncing to the beta repo. I did this once with 10.1 and the KDE repo and got into massive problems. The problem is that this repo is UNSTABLE! It is very early beta. You can introduce all sorts of problems.

    Doing an auto update is a whole lot different then syncing against an unstable development repo. That is what factory is. Hope you can see the difference.

  10. #10
    Join Date
    Jan 2010
    Location
    Orlando, FL
    Posts
    212

    Default Re: Automated script to run zypper dup periodically

    Quote Originally Posted by gogalthorp View Post
    What he is doing is syncing to the beta repo. I did this once with 10.1 and the KDE repo and got into massive problems. The problem is that this repo is UNSTABLE! It is very early beta. You can introduce all sorts of problems.

    Doing an auto update is a whole lot different then syncing against an unstable development repo. That is what factory is. Hope you can see the difference.
    I'm using the Factory KDE repos. My KDE version currently is: Platform Version 4.4.1 (KDE 4.4.1) "release 227"

    Right now the machine is fast and very stable. Is it suggested that I disable the factory repos at this time?
    It was my understanding that all I was updating were bug fixes until the next Beta comes out....please enlighten me as I'm new to openSUSE and use this for work.

    thanks
    Cheers, Big Ears!

    DΞLL Precision M6500: i7-820QM w/USB 3.0, 8.0GB DDR3-1333, Intel x-25M 160 G2 + 500GB 7200.3, nVidia Quadro FX 3800M 1.0GB DDR3, RGBLED, Intel 6300//Win7Pro x64
    DΞLL Vostro 1220 //openSUSE 11.3 KDE/Win7Pro 32

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •