Automatic update script issue (Ubuntu server)

Thread Tools Search this Thread
Operating Systems Linux Ubuntu Automatic update script issue (Ubuntu server)
# 1  
Old 08-24-2012
Java Automatic update script issue (Ubuntu server)


I've created a very basic script to run apt-get update and apt-get dist-upgrade unattended (run with cron) and save the logs. Though, it's not really a script, just a file containing the commands to run in order: pasteit .com/18601

I'm currently testing this and ran into some unexpected behavior during the recent Kernel upgrade: pasteit .com/18602

It appears the grep for the Kernel name kicked in and restarted the server before the upgrade even started. Does apt-get dist-upgrade run in the background or should the script wait for the process to finish before proceeding to the next step?

The following day it then did it correctly but in a non-test scenario it wouldn't run for another month pasteit .com/18603

I'm basically trying to find out if this is a script error. Someone else mentioned that they checked the server the day it failed to update and apt-get dist-upgrade said there were no outstanding patches but I can't confirm this.

Any help would be appreciated!

P.S. I realize that the -q is not required, will remove that!
# 2  
Old 08-24-2012
Does apt-get dist-upgrade run in the background or should the script wait for the process to finish before proceeding to the next step?
Yes, it is recomended that apt-get dist-updagrade finished, the problem just you said, is the grep Kerne. You can try with while or something.

# 3  
Old 08-24-2012
Thanks for the reply. Unfortunately I didn't fully understand your suggestion.

I'm assuming there's a 'while' command for bash or something? I'll look into it in any case and hope for a reply from yourself - or someone else.
# 4  
Old 08-24-2012
Hello, sorry I try to explain better. Do you need to find some way to check the process apt-get dist-upgrade finshed before check the grep Kernel.
# 5  
Old 08-31-2012

I've updated the script a bit: pastie .org/private/ehdhernqizakgqomcznnoa

It no longer reboots when it fails but it's still stopping at:

Get:85 (removed link) precise-updates/main python-crypto amd64 2.4.1-1ubuntu0.1 [293 kB]
Fetched 87.3 MB in 53s (1,632 kB/s)

It doesn't display the echo after dist-upgrade or anything...

As to the previous reply I would like a way to check but I had assumed && was a simple way to achieve this?

Also, I think this might be happening because of errors when trying to fetch files e.g. hash sum mismatches or bad requests..

Please help!

Last edited by Raxje; 08-31-2012 at 10:27 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem with GREP + CUT - script for automatic update of STEAM GAME AR

Hello, I have a problem with the /etc/rc.d/init.d script to automatically update STEAM GAME ARK. I've converted 3 scripts into one, but something does not work correctly ... The problem is in the file latestavailableupdate.txt / line 36/39. It think the problem is with script, it wrongly... (2 Replies)
Discussion started by: kshishu
2 Replies

2. Red Hat

RedHat 5 update 9 BASH update issue

Hi i want to update the BASH because of the "shell shock" vulnerability. my RedHat 5 is clean install with the default mirror site. when im running the command: yum update bash im getting a message saying there is no update. you can see in the attach picture... what am i doing wrong? is... (4 Replies)
Discussion started by: guy3145
4 Replies

3. Shell Programming and Scripting

Create a specific bash to increase the automatic update on my pi

hi everyone, I just began to be interested about the bash access. I buy a time ago a Raspberry pi, I installed raspbmc and now I would like build a bash to copy everyday all new files inside my server directly on the hard drive in my Pi. So my HDD is directly plug on my pi with usb connect,... (4 Replies)
Discussion started by: nagito34
4 Replies

4. Shell Programming and Scripting

Shell script to read from a file and update remote server

Its a tough one and would appreciate any guidance for a script that i am trying to develop....Again I do understand its a complicated script and help would be greatly appreciated.... Thank you 1- Need to check for a file (in a certain location on a server) every 15 minute or so if it is there... (4 Replies)
Discussion started by: aavam
4 Replies

5. Windows & DOS: Issues & Discussions

Configure automatic script in windows server

Dear Experts, I have database running,on windows server 2003 and my database are going down frequently due to some oracle bug. I need help to configure the automatic script which run's and check the database status, if database is down then send me email. Thanks in Advance. (32 Replies)
Discussion started by: Mohammed Fareed
32 Replies

6. UNIX for Dummies Questions & Answers

Would like to install x86 desktop Ubuntu over AMD64 Ubuntu server

My intention was to build a dual boot XP Pro 64 and Ubuntu media server. I had installed the AMD64 version of Ubuntu 8.10 server and thought that I would be able to install Apache server. I need a GUI to work in. I tried to boot and install Mythbuntu 32 bit 8.10, but my machine now won't recognize... (0 Replies)
Discussion started by: docflyboy
0 Replies

7. Shell Programming and Scripting

Script to check file update on ftp server

Hi everybody, Is there a way to do a stat of files on a ftp server? I have a database which is populated by the contents of these files. I want to setup a crontab to check if there has been an update to these files. If the file has been updated I will download it and then update my database. ... (2 Replies)
Discussion started by: z1dane
2 Replies

8. Solaris

Script for automatic deletion of trash file of mail server

Hi, I have a mail server with limited space and operating system is sun solaris 8 (sparc). I do not have provisions to increase the space for home directory. So i have to delete files from /home/username/mail/trash which are more than 10 days old automatically. So my script should be like... (1 Reply)
Discussion started by: crown2100bd
1 Replies
Login or Register to Ask a Question

Featured Tech Videos