# How to backup FTP to Synology Station

Having backups of your website or/and ftp server is an important part of administrator’s life. There are multiple ways to…

blog

27 Jan 2016 pl

![How to backup FTP to Synology Station](/wp-content/uploads/2016/01/synology1511.jpg)

[Zobacz obrazy (18)](#pf-content-image-1-0)

Having backups of your **website** or/and **ftp server** is an important part of administrator's life. There are multiple ways to set it up but our **Client** asked us provide him solution to backup his** ftp files** to his personal **Synology** at home. Synology with it's **full features** offered as standard package is perfect for this scenario.

### 📋 Prerequisites

To prepare **Synology** to get files from an ftp server and store it safely on **Synology** we need to prepare couple of things first.

Login to your **Synology Station**

[!\[Pulpit Synology DSM po zalogowaniu\](/wp-content/uploads/2016/01/img_56a8d8ef360f7.png)](/wp-content/uploads/2016/01/img_56a8d8ef360f7.png)

- Open your **File Station **

[!\[Otwarty Synology File Station na pulpicie DSM\](/wp-content/uploads/2016/01/img_56a8d940bf5e7.png)](/wp-content/uploads/2016/01/img_56a8d940bf5e7.png)

- Create **New Shared Folder**

[!\[Menu Create w Synology File Station z wybrana opcja New Shared Folder\](/wp-content/uploads/2016/01/img_56a8d95810dc0.png)](/wp-content/uploads/2016/01/img_56a8d95810dc0.png)

- Pick a name for it according to your prefered standards. In our case it's called **SecureBackups** and we've enabled **Recycle Bin** option (although not necessary it comes useful).

[!\[Okno New Shared Folder dla katalogu SecureBackups z wlaczonym Recycle Bin\](/wp-content/uploads/2016/01/img_56a8da14518c4.png)](/wp-content/uploads/2016/01/img_56a8da14518c4.png)

- After pressing **OK **we're given an option to choose users who will be able to access the **Shared Folder** (either from **Mac** or **Windows**). This step is not really necessary for the backup itself but our Client wanted to have access to his backups from his **Mac** so he can do verification of content from time to time.

[!\[Kreator uprawnien dla folderu wspoldzielonego Synology pokazujacy dostepnych uzytkownikow\](/wp-content/uploads/2016/01/img_56a8daa0ea322.png)](/wp-content/uploads/2016/01/img_56a8daa0ea322.png)

- Select proper permissions for the user (in our case **Read/Write** for **admin**)

[!\[Ekran uprawnien przyznajacy konto admin z dostepem Read Write\](/wp-content/uploads/2016/01/img_56a8db17bf73d.png)](/wp-content/uploads/2016/01/img_56a8db17bf73d.png)

- After pressing **OK **newly created **share** should be available within **Synology** **File Station**

[!\[Folder wspoldzielony SecureBackups widoczny w Synology File Station\](/wp-content/uploads/2016/01/img_56a8db7866180.png)](/wp-content/uploads/2016/01/img_56a8db7866180.png)

- The important thing now is to find where the folder **SecureBackups **is actually stored on our **Synology. **Right click on **SecureBackups **and choose **Properties.**

[!\[Menu kontekstowe folderu SecureBackups z zaznaczona opcja Properties\](/wp-content/uploads/2016/01/img_56a8dbb34da22.png)](/wp-content/uploads/2016/01/img_56a8dbb34da22.png)

- As you can see below our newly **shared directory **is available at **/volume1/SecureBackups**

[!\[Wlasciwosci folderu pokazujace sciezke SecureBackups na volume1\](/wp-content/uploads/2016/01/img_56a8dc1729618.png)](/wp-content/uploads/2016/01/img_56a8dc1729618.png)

- With that knowledge in mind we can now setup **backup of** **ftp server to Synology**.

### 💾 Solution

In the last step we need to configure a new **Task** in **Task Scheduler **that is available in **Control Panel**

[!\[Panel sterowania Synology z zaznaczonym Task Scheduler\](/wp-content/uploads/2016/01/img_56a8df10c77c6.png)](/wp-content/uploads/2016/01/img_56a8df10c77c6.png)

- Open **Task Scheduler**

[!\[Okno Task Scheduler w Synology DSM\](/wp-content/uploads/2016/01/img_56a8df6f2ed9b.png)](/wp-content/uploads/2016/01/img_56a8df6f2ed9b.png)

- Create new Task by pressing **Create** and choosing proper option that's suitable for your scenario. In our case we wanted to run this on **daily basis** so we've choosen **Scheduled** – **User-defined script.** Choose a proper name for the **Task** and switch to next tab

[!\[Okno Create Task skonfigurowane dla zaplanowanego skryptu uzytkownika\](/wp-content/uploads/2016/01/img_56a8e075eda99.png)](/wp-content/uploads/2016/01/img_56a8e075eda99.png)

- On next tab you can **schedule** the times of **backup** depending on your needs. I would advise something around 3, where the possibility of **internet** interruption is the lowest.

[!\[Karta harmonogramu pokazujaca codzienna konfiguracje czasu kopii zapasowej\](/wp-content/uploads/2016/01/img_56a8e1aa0f3c1.png)](/wp-content/uploads/2016/01/img_56a8e1aa0f3c1.png)

- On the final tab… this is where the magic happens..

[!\[Karta ustawien zadania gdzie dodawany jest skrypt kopii zapasowej\](/wp-content/uploads/2016/01/img_56a8e2061164c.png)](/wp-content/uploads/2016/01/img_56a8e2061164c.png)

- As the script we've prepared is very short and doesn't require much work you can simply copy/paste it's content into the box

[!\[Skrypt uzytkownika wklejony do pola polecen w zadaniu Synology\](/wp-content/uploads/2016/01/img_56a8e694891eb.png)](/wp-content/uploads/2016/01/img_56a8e694891eb.png)

There are 2 lines in the script. The first line is doing mirroring of the currently selected **FTP Server **and putting it's content into **/volume1/SecureBackups. **The 2nd line is responsible for packing that content into **dated.tar.gz** **archives **providing a go back scenario.

```plain
wget -m ftp://:@/* -P /volume1/SecureBackups
tar -zcvf /volume1/SecureBackups/backup-$(date +%Y-%m-%d-%H-%M-%S).tar.gz /volume1/SecureBackups//
```

This little script does couple of nice things:

- It mirrors current structure of the ftp server as found.
- If rerun it compares the content in current folder on Synology with content on ftp and only redownloads the differences.
- It backups current state after the backup is made into dated archive so one can go back in time without much effort.

So after we're happy with how the script looks like we can finish creating our task.

- After pressing **OK **our **task** is saved. To verify it's functionality simply press **Run** and verify it's results.

[!\[Zapisane zadanie kopii zapasowej Synology gotowe do recznego uruchomienia\](/wp-content/uploads/2016/01/img_56a8e577995a8.png)](/wp-content/uploads/2016/01/img_56a8e577995a8.png)

- Confirm choice

[!\[Okno potwierdzenia przed uruchomieniem zadania kopii zapasowej Synology\](/wp-content/uploads/2016/01/img_56a8e5e4023aa.png)](/wp-content/uploads/2016/01/img_56a8e5e4023aa.png)

In our case after running a script new folder **.nazwa.pl **(which is hostname of the server we've chosen for backup – in script it's defined as ) is created with proper ftp content. Additionally since we've run the script twice there are 2 backups in form of packed content. **Enjoy**.

[!\[Struktura folderow z backupem FTP utworzona na udziale Synology\](/wp-content/uploads/2016/01/img_56a8ea58d899b.png)](/wp-content/uploads/2016/01/img_56a8ea58d899b.png)![Skompresowane archiwa backupu z data zapisane na udziale Synology](/wp-content/uploads/2016/01/img_56a8e99b2e6ef.png)

## Powiązane projekty

Projekty powiązane z tagami, kategoriami i treścią tego wpisu.

[Wszystkie projekty](/projekty/)

Trwa dopasowywanie projektów...

[Powrót do bloga](/blog/)

## Powiązane wpisy

- [Check an API write after a PowerShell timeout](/blog/verify-uncertain-api-outcomes-powershell/)
- [Inspect and convert mixed Office archives with PSWriteOffice](/blog/inspect-and-convert-mixed-office-archives-pswriteoffice/)
- [Compose PDF reports and automate page workflows with PSWriteOffice](/blog/automate-pdf-reports-and-page-workflows-pswriteoffice/)

<!-- PowerForge markdown artifact sha256:970C8E2A2ADD61D156660D6985EBCBAE03D8C5770A3E4BDB96AD5531A21A43AC -->
