未加星标

The story of a failed archival utility

字体大小 | |
[系统(linux) 所属分类 系统(linux) | 发布者 店小二04 | 时间 2016 | 作者 红领巾 ] 0人收藏点击收藏

Sometime circa the time when I started writing this blog I had more than 800 directories in my computer's home directory. There were projects of others and projects of mine mixed merrily together. Most of it all was not documented. Most of it was chaff.

For about a half year I had made directory entries that had creation date in them. This turned out troublesome because lots of my work was such that I'd return to work on it later.

I got an idea that I should start archiving my work, but having hundreds of directories to work through I decided to write a tool to help me archiving it all.

This tool collected a date-sorted list of entries that haven't been touched during the last 7 days from my home directory and write a message-of-the-day summary such as:

55 files to archive run 'archive list' to see details.

I put it into cron -table to run it periodically once in a week. To print the motd, I put cat software/archive/motd into my .bashrc , which is a startup and configuration script for a linux terminal.

The archive -script had 'list' and 'ignore' -subcommands. The list -command would show the output of last periodic run of the scan -command. That another command would insert a file into an ignore -list, which would let the archiver ignore the files that shouldn't be archived.

The item would disappear from the 'archive list' if it was moved or ignored with the 'ignore' -command. This would let me document the files and move them into a/yyyy-mm-dd/ subdirectories based on their age.

The plan was I would archive handful of files once in a week and write a description of what it was. I just stopped doing the archval work shortly after I had made the tool because I weren't motivated to do it. There ended up being total of 32 entries in the a/ directory.

Despite how it turned out, this illustrates the beauty of a *nix system. The principles and design under Unix allows you to piece up thousands of independently developed programs together into a well-functioning operating system.

The unix-lessons of designing and maintaining extremely large projects are ignored by the professional amateurs of the software industry. Problems with large monolithic software are still attempted to solve by throwing more resources at it .

On the basis the ideas of Unix are based on the divide and conquer paradigm. Break large programs and problems into small pieces that have limited forms of communication with each other.

There's always someone who claims that this won't work on their project with thousands of participants and million lines of source code. I yet have had to see such a program.

本文系统(linux)相关术语:linux系统 鸟哥的linux私房菜 linux命令大全 linux操作系统

主题: Linux
分页:12
转载请注明
本文标题:The story of a failed archival utility
本站链接:http://www.codesec.net/view/483854.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(linux) | 评论(0) | 阅读(22)