Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

automator to download update at a certain time

Is there a automator script that can check for update in AppleStrore and download them at a certain time, like 02:05. It's a that time that I can download without extra cost and with a better satellite speed.


Thanks..


Robert

MacBook Pro, OS X Yosemite (10.10.3), SSD 500 gig 8 gig ram

Posted on Jun 17, 2015 12:09 PM

Reply
Question marked as Best reply

Posted on Jun 17, 2015 12:45 PM

I think you may want to use the 'softwareupdate' command.

I don't think the App store is scriptable enough to allow the updates to be installed, instead you could call a 'do shell script' from automator or Applescript.

This only covers Apple updates - third party apps are not included as far as I can see.

The manual for the command is at…

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/ man8/softwareupdate.8.html


I think all you need is…

sudo softwareupdate -d -a

…for downloading the outstanding updates. You will need to disable automatic update checking to avoid it getting updates out of your own schedule.


You don't need sudo to list the outstanding updates 'softwareupdate -l' should show them all.


I suspect it wouldbe easier to avoid Applescript or Automator altogether (using sudo or administrator privileges will require user interaction), make a launchd plist to run the command for you as the root user.

Lingon can do that, or you can do it by hand but it is fairly involved, how comfortable are you in Terminal?

https://www.peterborgapps.com/lingon/

Basically you would need to create a text file with the correct permissions & syntax. Then load that into launchd, which then takes care of triggering it at the specified time.

8 replies
Question marked as Best reply

Jun 17, 2015 12:45 PM in response to Patro

I think you may want to use the 'softwareupdate' command.

I don't think the App store is scriptable enough to allow the updates to be installed, instead you could call a 'do shell script' from automator or Applescript.

This only covers Apple updates - third party apps are not included as far as I can see.

The manual for the command is at…

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/ man8/softwareupdate.8.html


I think all you need is…

sudo softwareupdate -d -a

…for downloading the outstanding updates. You will need to disable automatic update checking to avoid it getting updates out of your own schedule.


You don't need sudo to list the outstanding updates 'softwareupdate -l' should show them all.


I suspect it wouldbe easier to avoid Applescript or Automator altogether (using sudo or administrator privileges will require user interaction), make a launchd plist to run the command for you as the root user.

Lingon can do that, or you can do it by hand but it is fairly involved, how comfortable are you in Terminal?

https://www.peterborgapps.com/lingon/

Basically you would need to create a text file with the correct permissions & syntax. Then load that into launchd, which then takes care of triggering it at the specified time.

Jun 17, 2015 4:12 PM in response to Drew Reece

Thank you very much. You are right. I will red all that documentation and see the shell command.


You are indeed right I don't want a script. I understand very well shell commands I did not know the this one exist,


Robert


P.S. I try to give you the credit but I don't know why, the button this solve my question didn't work properly.


Warm regards

Jun 17, 2015 5:07 PM in response to Patro

This is one I grabbed from a 10.9 system…

It has some extra options but you can see the way you setup the schedule.

You could use cron instead if you like, but Apple have been suggesting launchd is the way to go for sometime.


It is a user job, so the 'Aqua' session is not required on system jobs (I don't have any system level schedule jobs), I may be recalling incorrectly, so check the docs too 🙂.




<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>Label</key>

<string>backup-mac</string>

<key>LimitLoadToSessionType</key>

<string>Aqua</string>

<key>ProgramArguments</key>

<array>

<string>/Users/USERNAME/scripts/backup.sh</string>

</array>

<key>LowPriorityIO</key>

<true/>

<key>Nice</key>

<integer>1</integer>

<key>StartCalendarInterval</key>

<array>

<dict>

<key>Weekday</key>

<integer>0</integer>

<key>Hour</key>

<integer>18</integer>

<key>Minute</key>

<integer>10</integer>

</dict>

</array>

</dict>

</plist>

Jun 17, 2015 5:21 PM in response to Drew Reece

P.S

The system jobs go in /Library/LaunchAgents & need to be 644 for root wheel

[~]$ ls -l /Library/LaunchAgents/

-rw-r--r--@ 1 root wheel 792 3 Mar 01:45 com.google.keystone.agent.plist


Load/ unload them with…

sudo launchctl load -w /Library/LaunchAgents/com.google.keystone.agent.plist

sudo launchctl unload -w /Library/LaunchAgents/com.google.keystone.agent.plist


-w saves the disabled state meaning it will persist after reboot.

Jun 25, 2015 9:11 PM in response to Drew Reece

Hi Drew.

sorry for the delay to continue this discussion, but I had a little cardiac concern and I am now at the hospital. I will need a cardiograpy (stens) and after that i will be fine.

I read many of the link that you post I can start with the upgrade command and after that work with crown

But one thigh read was interesting and I did not understand it very well.

It is regarding the download speed that is very, very slow. On the that I don't remember, I read something related to the the use y apple off the Akamy distributed secure network.

It seems that is a major issue and my concern.

As I understand it, this network use many mirror site around the world to distribute the software. based on the dns used Akamy redirect the software to the nearest dNS of the supplier. But this not means that the dns supplier is near your computer. so the path followed by the data from the supplier's Dns and our computer can be very long and passing from one switch to the other. I did not read further for the solution because i was getting sick.


Does this means anything to you?

If I install Apple server and configure it so the the nearest dns will be me rather than google or open DNS or xplornet DNS will this accelerate the download speed ?

Thanks for reading and please accept m apologies for my English.


Warm Regards

Robert

automator to download update at a certain time

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.