Restore Backup, how to Backup only files in the specified path

i’m trying Restic for Backup files and Database. I’m getting a little issue when i try to restore.

  1. I make a repository: restic init --repo /home/relic
  2. I’m trying to backup a folder: restic -r /home/relic --verbose backup /home/valeria/public_html
  3. After copy end, i’m checking the snapshots: restic -r /home/relic snapshots
  4. So now, i tried to delete che content of /home/valeria/public_html and after tried to restore backup with: restic -r /home/restic restore 446c66ac --/home/valeria/public_html

At this point i have an issue, in the folder /home/valeria/public_html, I expect only the content of “public_html” to be copied but every time Restic copy in the /home/valeria/public_html/home/valeria/public_html/ .

So not copy only the content of public_html but all the root of the folders. How can i fix it?
What’s wrong?

Thank you

Thanks for elaborating with commands when asking about this :slight_smile:

There’s nothing wrong, it works as designed. It’s just a matter of expectations. Restic restores the snapshot with the absolute paths that it was given at backup time.

To “fix” this, you simply move the files where you want them (or you could just move the entire restored public_html directory instead):

cd /home/valeria/public_html
mv home/valeria/public_html/* home/valeria/public_html/.* .
rmdir -p home/valeria/public_html
1 Like

Hello rawtaz,
Thank you for the support and reply.
I thought there was some explicit command to copy content only.

Any way thank you for the reply :slightly_smiling_face: