You are not logged in.

#1 2021-12-19 09:46:56

Registered: 2017-12-09
Posts: 46

[SOLVED] Backup the folder structure of my HDD in a textfile

Hello I want to periodically backup the folder structure of my hard disk. My needs:
- I'd like to use a fast and light process to generate the text file
- I'd like to sort folders at the beginning
- I'd like to use different colors (or a good "tree"formatting too) for files and folders in order to be easy to read (I've a lot of hdd with a lot of folders/subfolders/files).
optional: if I can get expandable folder in an html file, it should be very useful in order to expand/reduce the structure

I used the following script but it's slow and not so well formatted (not easy to read). Do you know a better way to do it?

DATETIME=$(date +"[%d-%b-%Y][%H.%M.%S]")
mkdir -p "$OUTPUT/$DATETIME"
tree -H baseHREF --nolinks -C -D --dirsfirst -h "/root/to/scan" > "$OUTPUT/$DATETIME/FolderStrucuture.html"

Last edited by pepper (2021-12-23 09:11:41)


#2 2021-12-19 23:51:01

Registered: 2015-05-24
Posts: 224

Re: [SOLVED] Backup the folder structure of my HDD in a textfile

Not used but linuxdir2html seems to fit the job:



Board footer

Powered by FluxBB