Trouble on backing up remote cloud, saving to local

Recently, I try to look into ways to backup remote cloud, saving to local… And from this previous post, cdhowie suggests to use rclone mount to mount the cloud storage as local volume and then run restic backup against it.

However, when I try to follow these steps, restic backup is indeed running against that mounted local volume but eventually no files is being backed up to the local storage. It seems as if running against an empty directory.

Below are the detailed code I use:

rclone mount --vfs-cache-mode full rclone:host_ssh:public C:/Users/username/Desktop/host_ssh

restic -r D:/backup init

restic -r D:/backup backup C:/Users/username/Desktop/host_ssh

(Note: rclone config for my host via ssh has been setup before and I am not showing the full step here.)

And here is the result I get which I not desire:

Added to the repo: 1.474 KiB

processed 0 files, 0 B in 0:00
snapshot de1536c5 saved

Expected result: Able to backup about 200mb in that cloud storage.

1 Like

It seems to me that you have backed up one file only:
C:/Users/username/Desktop/host_ssh

EDIT: Maybe not even that. According to https://restic.readthedocs.io/en/latest/manual_rest.html the backup syntax is:

restic backup [flags] FILE/DIR [FILE/DIR] ...

… which is not what you are doing. I suggest you read up on the command line syntax and try again. If it still doesn’t work, please quote the full command line and the output from restic.

Good luck! And welcome to the forum, by the way!

1 Like

Thanks @martinleben for your guide. I have tried to follow the restic backup syntax you have shown, but the result is still the same. Only backup 4 directory folders instead of the files inside.

# First step: rclone mount
C:\WINDOWS\system32>rclone mount --vfs-cache-mode full pickufly_ssh: C:/Users/tys/Desktop/pickufly_ssh
The service rclone has been started.

# Second step: restic init (ps: open in another cmd)
C:\Users\tys>restic -r D:/backup init
enter password for new repository:
enter password again:
created restic repository aff658fae8 at D:/backup

Please note that knowledge of your password is required to access
the repository. Losing your password means that your data is
irrecoverably lost.

# Third step: restic backup
C:\Users\tys>restic backup -r D:/backup C:/Users/tys/Desktop/pickufly_ssh
enter password for repository:
repository aff658fa opened successfully, password is correct
created new cache in C:\Users\tys\AppData\Local\restic
no parent snapshot found, will read all files

Files:           0 new,     0 changed,     0 unmodified
Dirs:            4 new,     0 changed,     0 unmodified
Added to the repo: 1.466 KiB

processed 0 files, 0 B in 0:00
snapshot c2ee12e7 saved

What happens when you recursively show the content of your directory? I’m not using Windows but according to this page the Linux command ls -lR should be something like dir /b /s /a:-D, so please try this:

dir /b /s /a:-D C:/Users/tys/Desktop/pickufly_ssh

Does that show all the files you want to backup?

Hi, @nicnab. I follow your guide and then indeed got show the content of my mounted directory for my second try as below:

# first try: copy and paste your command
C:\Users\tys>dir /b /s /a:-D C:/Users/tys/Desktop/pickufly_ssh
Invalid switch - "Users".

# second try: change directory location first, and then use `dir /b /s /a:-D .` command
C:\Users\tys>cd C:/Users/tys/Desktop/pickufly_ssh
C:\Users\tys\Desktop\pickufly_ssh>dir /b /s /a:-D .
## results shown here
C:\Users\tys\Desktop\pickufly_ssh\.bash_history
C:\Users\tys\Desktop\pickufly_ssh\.htaccess
C:\Users\tys\Desktop\pickufly_ssh\.viminfo
C:\Users\tys\Desktop\pickufly_ssh\public_html\wp-config.php
C:\Users\tys\Desktop\pickufly_ssh\public_html\wp-login.php
C:\Users\tys\Desktop\pickufly_ssh\public_html\wp-mail.php
C:\Users\tys\Desktop\pickufly_ssh\public_html\wp-settings.php
C:\Users\tys\Desktop\pickufly_ssh\public_html\wp-signup.php
... and a lot more files shown which are not specified here .....

So, is this rclone mount method for restic backup only supported when using linux OS but not windows?

Hm weird. Fortunately, I never have to deal with Windows but maybe someone else has an idea? The only thing that comes to my mind would be changing to your pickufly_ssh folder and then try to restic backup . ?

1 Like

@nicnab Thanks for help. I think your advise works. I need first change directory location to my mounted folder and then try restic backup ..

Steps I have applied as below:

# First step: `rclone mount`
C:\WINDOWS\system32>rclone mount --vfs-cache-mode full pickufly_ssh: 

# Second step: `restic init` (note: open in another cmd)
C:\WINDOWS\system32>restic -r D:/backup init

# Third step: change directory to mounted local volume
C:\WINDOWS\system32>cd C:/Users/tys/Desktop/pickufly_ssh

# Fourth step: `restic backup`
restic backup -r D:/backup .

Please try using backslashes instead of forward slashes for the path.

3 Likes

Haha, thanks @764287 . This works since the default path directory of windows is using backslashes instead of forward slashes.

The code shown as below:

First step: `rclone mount`
C:\WINDOWS\system32>rclone mount --vfs-cache-mode full pickufly_ssh: "C:\Users\tys\Desktop\pickufly_ssh"

Second step: `restic init` (note: open in another cmd)
C:\WINDOWS\system32>restic init -r "D:\backup"

Third step: `restic backup`
C:\WINDOWS\system32>restic backup -r D:\backup "C:\Users\tys\Desktop\pickufly_ssh"
2 Likes