Backup NTFS file and directory index tree

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
Starlight5
Posts: 28
Joined: Wed Jul 08, 2015 12:14 pm

Backup NTFS file and directory index tree

Post by Starlight5 »

I have 2x 2TB NTFS drives connected to my Pi2 which I have no means to back up. I do want to save the names of files and directories on those disks, the whole structure, to a file, on a weekly basis. Googling didn't help me, at all. A friend advised to setup local git server but that seems overkill - I do not need to keep the changes between files, only a basic snapshot so that in case some or all data is lost I know what was on that HDD. Is there some backup solution available to satisfy this requirement, preserving the index in readable form? If not, please help me with writing a bash script to implement this.
User avatar
Fourdee
Site Admin
Posts: 2782
Joined: Tue Feb 06, 2007 1:36 pm

Re: Backup NTFS file and directory index tree

Post by Fourdee »

Starlight5 wrote:I have 2x 2TB NTFS drives connected to my Pi2 which I have no means to back up. I do want to save the names of files and directories on those disks, the whole structure, to a file, on a weekly basis. Googling didn't help me, at all. A friend advised to setup local git server but that seems overkill - I do not need to keep the changes between files, only a basic snapshot so that in case some or all data is lost I know what was on that HDD. Is there some backup solution available to satisfy this requirement, preserving the index in readable form? If not, please help me with writing a bash script to implement this.
If you only want the complete filepaths of each file and directory in a list, this would do it:

Code: Select all

find /Path/To/Drive > saved_list.txt
As an example, if I want to list all files and folders in my USB drive, and save to a file:

Code: Select all

find /mnt/usb_1 > usb_drive_files.txt
And when I open usb_drive_files.txt:
Untitled.png
If you only want to list the files (including their full filepaths):

Code: Select all

find -type f /mnt/usb_1 > usb_drive_files.txt

As for automating this weekly, you create a cron job in /etc/cron.weekly/MyCronJob. Let me know if you need any assistance setting that up.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Starlight5
Posts: 28
Joined: Wed Jul 08, 2015 12:14 pm

Re: Backup NTFS file and directory index tree

Post by Starlight5 »

@Fourdee thank you!
Post Reply