0

I am trying to create a python3 app to store file backups on a remote server. Using rsync to sync between my local and remote machine works fine.

What I would like to achieve is a json file containing the server directory structure and file names, not the content of the files, only names, and store the structure as a json file to be returned to my python app.

I have tried using rsync commands to achieve this, but I keep copying complete files, I only need the directory names, and file names contained within the server, ideally I would like to be stored as a json file so I can convert to dict in my program.

My server runs ubuntu 18.04

Drew
  • 33
  • 6

1 Answers1

0

You can iterate through folders in your app recursively and create a tree structure. Here is how to get the content of a directory in python

Hope this helps!

Lakshan Dissanayake
  • 521
  • 1
  • 4
  • 18