# How to: Syncronize home folder from HD to external HD



## Deleted member 58914 (Oct 25, 2019)

The command I had been using to backup from the hd to the external hd is the following, you will need to have installed rsync.

```
rsync -avz --delete /home/YOURUSERNAME/SOURCEFOLDER/ /media/DISKNAME/BACKUPFOLDER/
```

This reverse command will restore the backup from the external hd to the hd.

```
rsync -avz --delete /media/DISKNAME/SOURCEFOLDER/ /home/YOURUSERNAME/TARGETFOLDER/
```

Due to the "--delete", *it will delete any files which exists at the target but do not exists at the source*, that is why I called it syncronize instead of a simple backup. If you want to test without the risk of losing your files, remove the "--delete"


----------

