fileinfo.c

Apuohjelma muuttuneiden ja uusien tiedostojen löytämiseksi.


 Ohjelma hyväksyy komentorivillä tiedoston nimen.
 Tulostaa tiedoston nimen ja unix modifikointiajan ja tiedoston koon.
 
 Idea on etsia tiedostot jotka ovat muuttuneet kahden ajokerran valilla.
 
 Kaanna ensin ohjelma:
 gcc -Wall -O2 -o fileinfo fileinfo.c
 
 Kaytto: 
 
 1. find / -type f -exec ./fileinfo {} ";" >/tmp/files.tmp
 2. sort -u < /tmp/files.tmp > /tmp/files.txt
 3. rm /tmp/files.tmp
 4. tee muutoksia, kopioi tiedostoja ym.
 5. find / -type f -exec ./fileinfo {} ";" >/tmp/files.tmp
 6. sort -u < /tmp/files.tmp > /tmp/files2.txt
 7. rm /tmp/files.tmp
 8. diff /tmp/files.txt /tmp/files2.txt
 
 Tulos on luettelo tiedostoista jotka ovat muuttuneet seka uudet tiedostot.
 

 Copyright 2007, Troy Korjuslommi, aka TJK.
 tjk@tksoft.com
 
 Latest copy available from http://www.plug.fi/

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License,
 version 2, as published by the Free Software Foundation.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 USA.

 Any express or implied warranties, including, but not limited to, 
 the implied warranties of merchantability and fitness for a 
 particular purpose are disclaimed.  In no event shall TJK,
 agents of TJK, or other contributors be liable for any direct, 
 indirect, incidental, special, exemplary, or consequential damages 
 (including, but not limited to, procurement of substitute goods or 
 services; loss of use, data, or profits; or business interruption) 
 however caused and on any theory of liability, whether in 
 contract, strict liability, or tort (including negligence or 
 otherwise) arising in any way out of the use of this software, 
 even if advised of the possibility of such damage.                    

Download fileinfo.c.

Copyright 2007 Tksoft Inc. All Rights Reserved.