# Powershell script for sysadmin to regularly download backups from server to computer

**URL:** <https://meta.discourse.org/t/powershell-script-for-sysadmin-to-regularly-download-backups-from-server-to-computer/280983>\
**Category:** Extras\
**Tags:** backups\
**Created:** [October 4, 2023, 1:10am UTC](https://meta.discourse.org/t/powershell-script-for-sysadmin-to-regularly-download-backups-from-server-to-computer/280983 "2023-10-04T01:10:40Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![45thj5ej](https://avatars.discourse-cdn.com/v4/letter/4/34f0e0/32.png) [@45thj5ej](https://meta.discourse.org/u/45thj5ej)\
**Post date:** [March 28, 2024, 7:27pm UTC](https://meta.discourse.org/t/powershell-script-for-sysadmin-to-regularly-download-backups-from-server-to-computer/280983/11 "2024-03-28T19:27:40Z")

</div>

For anyone reading this, here are better/more up-to-date instructions since I slightly struggled with the OP’s instructions:

1)Make/Use a folder where this script will be stored. Then, **create a folder called** `backup` **within that folder**.  
2)Copy/paste the script in Notepad. NOTE: If using a VPS, use your VPS’ username and the public IP address for the `$ssh_address = "username@your.site"` line. Save As `anyname.ps1` and don’t forget to set the drop-down box to “All Files,” as shown below.  
 ![hhhh](https://global.discourse-cdn.com/meta/original/4X/a/8/b/a8b39e80194a9cec99ebc7fb80ca98e1d59ac557.png)

3)Press Windows Key ⊞ and type in “Tasks,” then click “Task Scheduler.”  
4)On the right-hand side, click “Create basic task.”  
5)Give any name/description.  
6)Pick if you want daily/weekly/yearly/etc. I recommend Daily.  
7)Set the date & time you want to do this. Keep Recur at 1. **Make sure** you go into your Discourse site’s Admin settings \> Backups. Check the box next to `automatic backups enabled`.  
Then, set `backup frequency` to whatever you want. I recommend 1 **but the key here** is to have it match up with your Task Scheduler settings. Make the backup dates match up. Example: if you set Task Scheduler to backup Daily, set your Admin Backup `backup frequency` settings to `1`.  
8)Leave default setting at “start a program” and click Next.  
9)Click Browse and find the script you saved. Click Next.  
10)Click Finish.  
If you want to test it, right-click the script and choose “Run with Powershell.”

Note: If you get “the system cannot find the file specified,” then enter your password like it shows on PowerShell and it will find it anyway.

---

_[View the full topic](https://meta.discourse.org/t/powershell-script-for-sysadmin-to-regularly-download-backups-from-server-to-computer/280983)._
