Scoop icon indicating copy to clipboard operation
Scoop copied to clipboard

Add scheduled scoop update *

Open quantuumsnot opened this issue 4 years ago • 6 comments

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 ...

quantuumsnot avatar Sep 08 '19 21:09 quantuumsnot

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).

shoogle avatar Oct 17 '19 12:10 shoogle

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

quantuumsnot avatar Oct 17 '19 19:10 quantuumsnot

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? :)

cubagithub avatar Nov 15 '19 03:11 cubagithub

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

Scoop Update Apps - No Author.txt

nwesterhausen avatar Jun 01 '21 12:06 nwesterhausen

I'd mention that scoop update * may need to have scoop update ran beforehand, similar to apt update && apt upgrade.

jtagcat avatar Jun 02 '21 06:06 jtagcat

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.

Scoop.Update.Apps.txt

chipmunk87 avatar Sep 14 '22 16:09 chipmunk87

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.

Scoop.Update.Apps.txt

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"

CaseyLabs avatar Jun 18 '23 17:06 CaseyLabs

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";
  }
}

ilkka avatar Aug 01 '23 06:08 ilkka

Guys, try winget UI

image image

homjay avatar Aug 24 '23 07:08 homjay