bcurran3 / ChocolateyPackages

My published Chocolatey packages
207 stars 94 forks source link

Choco Package Backup not using configured variables #362

Closed kpupp closed 1 month ago

kpupp commented 2 months ago

I've set different backup locations according to the instructions (in c:\tools....), and no matter what I do, the script seems to not use them. Love this little app, would just love for it to NOT upload to my business OneDrive (and instead my own mapped network storage!) all the time! :)

bcurran3 commented 2 months ago

hi @kpupp

It should be as easy as editing choco-package-list-backup.config and set

    <UseOneDrive>false</UseOneDrive>

As for other locations, I'm not sure if you're talking about things that are baked in or the custom path's. If using a custom path, you need to set the location AND set that feature as true, e.g.:

    <CustomPath>c:\backup</CustomPath>
    <UseCustomPath>true</UseCustomPath>
dionvansevenant commented 1 month ago

EDIT I just read a few other Issues and then the main README. I see that Bill is no longer maintaining Chocolatey packages, so if there is actually an issue, it may not get resolved, unless someone else takes up the mantle.


After reviewing older comments on https://community.chocolatey.org/packages/choco-package-list-backup and seeing that using Google Drive might not work if it's not installed with default settings, I tried the suggestion of using a CustomPath as well:

   <CustomPath>g:\mydrive</CustomPath>
   <UseCustomPath>true</UseCustomPath>

It does not seem to accept that a CustomPath was added:

PS C:\WINDOWS\system32> cplb
Choco-Package-List-Backup.ps1 v2023.06.28 - backup Chocolatey packages list locally and to the cloud
Copyleft 2017-2023 Bill Curran (bcurran3@yahoo.com) - free for personal and commercial use

Choco Package List Backup Summary:

  ** Saving to DOCUMENTS:
  ** C:\Users\dion\Documents\ChocolateyPackageListBackup\packages.config SAVED!
  ** C:\Users\dion\Documents\ChocolateyPackageListBackup\packages_2024-09-08.config SAVED!
  ** C:\Users\dion\Documents\ChocolateyPackageListBackup\choco-package-list-backup.config SAVED!
  ** C:\Users\dion\Documents\ChocolateyPackageListBackup\AllProgramsList.txt SAVED!
  ** C:\Users\dion\Documents\ChocolateyPackageListBackup\AllProgramsList_2024-09-08.txt SAVED!
  ** C:\Users\dion\Documents\ChocolateyPackageListBackup\pins.bat SAVED!
  ** C:\Users\dion\Documents\ChocolateyPackageListBackup\pins_2024-09-08.bat SAVED!

  ** Consider getting InstChoco - The ULTIMATE Chocolatey and Chocolatey packages (re)installer!
  ** https://community.chocolatey.org/packages/instchoco

To re-install your Chocolatey packages: run CHOCO INSTALL PACKAGES.CONFIG -Y

Found Choco-Package-List-Backup.ps1 useful?
Buy me a beer at https://www.paypal.me/bcurran3donations
Become a patron at https://www.patreon.com/bcurran3

I have just today updated everything relating to Chocolatey and scripts that I can, so it should not be an issue of anything being out of date.

Thanks,

-- Dion

kpupp commented 1 month ago

This is/was my issue too - Dion beat me to it. I've tried adding the custom path in the C:/tools location and no matter how many times I do, it either doesn't take it, and/or the file resets.

It seems to only save to OneDrive when it's enabled (and my Business OneDrive account too, annoyingly). Will add some screenshots when can.

bcurran3 commented 1 month ago

I will maintain my creations. There will be updates publicly available sometime in the future.

I just did a quick test using CustomPath with v2023.06.28. I had no issues, everything worked for me as expected/scripted.

Make sure your custom path EXISTS. CPLB will not copy files if the path doesn't exist and it won't create it (intentional).

Make sure your custom path doesn't include any non-alpha numeric characters. There are some characters such as "[" that need to be escaped that I don't check for and handle in the script.

If the above wasn't useful, uninstall and re-install CPLB. Be sure to delete the config if it exists before re-install.

If there are still issues, post the choco-package-list-backup.log for me to view.

kpupp commented 1 month ago

Will do @bcurran3. You beat me to screenshots, too. :) Hopefully I can do all that tonight.

dionvansevenant commented 1 month ago

@bcurran3,

Thanks for the quick followup!

It's been so long since I've had to change anything in this config that I could not remember if the ChocolateyPackageListBackup folder had been created automatically or not.

Also, Google Drive's default seems to use spaces, which I missed, so creating the destination folder AND correcting g:\mydrive to g:My Drive worked.

    <PackagesListFile>packages.config</PackagesListFile>
    <SaveFolderName>ChocolateyPackageListBackup</SaveFolderName>
    <SaveTitleSummary>true</SaveTitleSummary>
    <SaveVersions>true</SaveVersions>
    <AppendDate>true</AppendDate>
    <CustomPath>g:\My Drive</CustomPath>
    <UseCustomPath>true</UseCustomPath>

Thank you!

-- Dion

kpupp commented 1 month ago

Seems to be working for me now too, @bcurran3. So weird, I could swear it wasn't before with my simple `X:/chocoBackup'. Either way, all seems well! I'll remember that bit about spaces, too (always the bane of scripts). Thanks for checking into it regardless! :)

bcurran3 commented 1 month ago

image