Archive your movie disk without using much space.
On my vacation a friend told me how he archives a directory listing of the disks containing his movies for backup. Since movies can be replaced easily by redownloading the content, it’s normally not worth keeping a backup of the movies themselves somewhere.
I found that quite smart. I’ve been using
ls -R to keep a history of my
~/Downloads for a while now, but wanted something that looks a bit nicer than
Better output with
tree is a command line utility1 that lists directory contents in a tree-like structure, but has the disadvantage that when you output the command to a text file, the encoding throws off TextEdit.
Luckily some people point to this article by Murphy. He uses
sed to format the output of
find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
The result looks pretty! To make this a command follow Sumedha’s instructions. Only replace the
find line with the original from Murphy.
Then just type
`tree ~ > tree_home.txt`.
You can now automate the process with Hazel, Keyboard Maestro, or a Launch Agent (hint: Lingon).
It’s safe to run this command maybe once a day or a week. Honestly, how often do your movies change?
I use this command to output a file containing the date and time the command has run:
tree /Volumes/extHome/ > "$HOME/Documents/History/$(date "+%Y-%m-%d %H-%M") extHome.txt"
- Pruning: Use Hazel or something else to remove old files.
- Modify the command to overwrite the same file. This way you only have one file, but also lose the possibility to go “back in time”.
Available in Homebrew, MacPorts and Fink. ↩