Scoop
Scoop copied to clipboard
Add scheduled scoop update *
Just did another manual update and thought it will be better if scoop has an option for scheduled update. I'm somewhat lazy to make one in Task Scheduler and there is an obstacle doing that - for example checking if scoop is not running/updating or some of the apps are ...
Perhaps a scoop command to add itself to the startup list? e.g.
scoop autoupdate enable
Would also be nice to have a periodic cleanup to empty the cache and delete all but the most recent versions of each app (with the option to keep one version prior as a backup).
Yes, probably a simple Yes/No question loop for each version ...
Come on, scoop has the momentum to become a perfect substitute of automated linux package managers
I've just appended this to my PS profile [C:\Users%username%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1]
Read-Host -Prompt "Press ENTER to update Scoop apps, or Ctrl+C to cancel..."
scoop update *
So whenever I open a new powershell window I am reminded. Semi-auto update? :)
I found this thread when I was checking for suggested ways to run the scoop update on a schedule. I ended up just making a scheduled task to do it. I've removed the Author information from the attached XML which can be imported into Task Scheduler and should fill your user in and execute as you.
Note that github doesn't allow .xml files as attachments, so I've uploaded it here as a .txt. Task scheduler expects a .xml
I'd mention that scoop update *
may need to have scoop update
ran beforehand, similar to apt update && apt upgrade
.
I have modified the script slightly to do update update * instead of just update * and tweaked a little so can see if it is working (see attached). It needs to be renamed back to XML to work.
I have modified the script slightly to do update update * instead of just update * and tweaked a little so can see if it is working (see attached). It need to be renamed back to XML to work.
Thank you for this! For future readers coming from a google search, here is a quick Powershell script for installing this task:
Invoke-WebRequest -Uri "https://github.com/ScoopInstaller/Scoop/files/9568039/Scoop.Update.Apps.txt" -UseBasicParsing -OutFile task.txt
Register-ScheduledTask -Xml (Get-Content -Path "task.txt" -Raw) -TaskName "ScoopUpdate"
To get something similar I dropped this in my $PROFILE
for updates once a week when opening powershell:
if (Get-Command scoop 2> $null) {
$doUpdate = $true;
if ($lastupdate = Get-Content "$env:LOCALAPPDATA\last-scoop-update-timestamp" 2> $null) {
if ( (Get-Date -UnixTimeSeconds ([int]$lastupdate + 7 * 24 * 60)) -gt (Get-Date) ) {
$doUpdate = $false
}
}
if ($doUpdate) {
scoop update;
scoop update -a;
scoop cleanup -a;
Get-Date -UFormat "%s" > "$env:LOCALAPPDATA\last-scoop-update-timestamp";
}
}
Guys, try winget UI