Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keep track of filesystem (folders/files) states by saving them

I'm looking for a way to track changes of a folder, with sub-folders and files, from time to time - not in real time. Basically I want to know which folders/files that was changed (changed or delete) from the last time I looked.

A simple solution would be to make a copy of the entire folders/files and then do some diff when I want to know what have changed. I could touch the files so they wouldn't take up any space and look at the file date to see if it was changed. ...but it doesn't seem like a good option.

This would take place on a Linux system. The file-system I would watch would be mounted (out of my control) but the other file-system would I be in control of, if anyone was thinking about some specific trick for a file-system.

Do anyone got a good solution?

like image 614
AxAn Avatar asked Nov 21 '25 07:11

AxAn


1 Answers

Git seems like a good solution. You can track changes, go back to different versions of the file, make branches, and get a diff of any commits to what your current state of the file is.

You can do a free class to get started

https://www.codeschool.com/learn/git

You can go into the folder you want to track. Then initialize the folder with

git init

add all files and folders

git add .

commit changes

git commit -m "some message"

after changing files to see changes

git status

add the new changed files

git add "the file you changed"

then do a commit

git commit -m "some message"

like image 57
aowen Avatar answered Nov 23 '25 02:11

aowen