Title

Message

Confirm

<< DiscussionsReply

Scheduling DisplayFusion Settings Backups to delete older files

ramoses
8 discussion posts
Hi, I've just installed DisplayFusion and I am loving it, yet I can't find a solution to my problem, here it is:
I have created a taks in the Windows Task Scheduler just like it's said here and it is working just fine, YET I noticed that the old files won't be deleted automatic. Is there any other command line or task that must be added to automate this?
Apr 29, 2021  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
I could write up a PowerShell script that will clear out the files that are older than N days. Just let me know what the full path to the folder where your backups are stored, and how many days you want to keep.

Thanks!
May 4, 2021  • #2
ramoses
8 discussion posts
Thank you so much for the reply! The backup is setted to be done daily at 00:00:01, I want to keep the other files for 7 days.
May 4, 2021 (modified May 4, 2021)  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
What folder are the backups stored in?
May 5, 2021  • #4
ramoses
8 discussion posts
Sorry, forgot the path, here it is: C:\Users\usuário\Documents\DisplayFusion Backups
May 5, 2021  • #5
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ok, here you go! Some notes on this:
  • Be careful with this script, it will not send the files to the recycle bin, and it won't prompt for confirmation!
  • You can set the number of days to keep on line 1.
  • You can set the path on line 2.
  • You can run it like this:
    powershell.exe -ExecutionPolicy Bypass -File C:\path\to\CleanupDFBackups-EDIT-PATH-ON-LINE2.ps1

Hope that helps!
• Attachment: CleanupDFBackups-EDIT-PATH-ON-LINE2.zip [411 bytes]
May 6, 2021  • #6
ramoses
8 discussion posts
Quote:
Ok, here you go! Some notes on this:
  • Be careful with this script, it will not send the files to the recycle bin, and it won't prompt for confirmation!
  • You can set the number of days to keep on line 1.
  • You can set the path on line 2.
  • You can run it like this:
    powershell.exe -ExecutionPolicy Bypass -File C:\path\to\CleanupDFBackups-EDIT-PATH-ON-LINE2.ps1
Hope that helps!

Thank you for the help! Just to know if I'm doing everything just right: I've replaced the old executable with the paratemer to backup DisplayFusion to a .bat file with the following script
powershell.exe -ExecutionPolicy Bypass -File C:\path\to\CleanupDFBackups-EDIT-PATH-ON-LINE2.ps1
, so it will trigger everyday the .bat file that will run the Powershell script. Is this ok?
May 7, 2021 (modified May 7, 2021)  • #7
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Sorry, I had set it only to cleanup the files so that you could run it separately from the backups.

I've attached a new version (different file name too). It will backup to the default location (%userprofile%\Documents\DisplayFusion Backups), then it will prune the old backups from the folder you specify on line 2.

In your scheduled task, the application should be
powershell.exe
and then the rest (
-ExecutionPolicy Bypass -File C:\path\to\CleanupDFBackups-EDIT-PATH-ON-LINE2.ps1
) goes in the arguments box.
• Attachment: BackupDFSettings-EDIT-PATH-ON-LINE2.zip [487 bytes]
May 7, 2021  • #8
Was this helpful?  (1)  
<< DiscussionsReply