ftpindex
Buenos Aires
Argentina
|
|
Download it.
(Licenced under de GPLv2 or later )
----8<---README----8<--------
Sat, 30 Mar 2002 14:55:13 -0300
Build 2
Introduction
ftpindex is a 5 minute hack to track the files of a ftp site without
user intervention. It isn't elegant
Requirements
You will need ftpfs module (ftpfs.sourceforge.net)(you need linux
2.4.x), bash 2.x (for bash functions!) and a root shell ( :^( )
Installation
Edit ftpindex.sh and set :
MNTDIR directory under configs are keep and where
the ftps are mounted
DATADIR directory under data file are keep
FTPMOUNT where is the ftpmount utility?
FTMOUNTOPTS any extra option to ftpmount?
Then just copy ftpindex.sh where you want...(ie. your bin directory)
The program need to mount and unmount directories so you need to be
able to follow one of these 3 conditions:
o have the root power ( easy to run, with danger if not
chrooted)
o a mount suid'ed (i would never recomend you this)
o entries in /etc/fstab so it all can be mounted by user.
not currently suppoted but i expect your patch)
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
This program saves the ftp sites's passwords embeeded in the
filesystem (with proper permitions), so be aware. It is easy
to encode these (change encode/decode functions), but would
be easy to revers it. next version will encrypt it (any
patch?..je)
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
Usage and hack:
Just see ftpindex -h...if you have troubles come back.
I put as MNTDIR /root/ftpindex/mnt and DATADIR as /root/ftpdindex/data
# ./ftpindex.sh -h
Usage: ftpindex.sh [OPTIONS]
OPTIONS:
-a ftpstring add `ftpstring' as an ftp to check and die
-r ftpstring remove `ftpfstring' from checking list and die
-c ftpstring cleans old files for an ftpstring list and die
-m generates output to be mailed (not yet)
-g check all sites!!!
-h show this help and die
-s shows ftpstring listings
-v show the version and die
ftpstring is like user:pass@host:port (Eg: sunsite.unc.edu)
# ./ftpindex.sh
`/root/ftpindex/mnt' directory does not exists. mkdir...
`/root/ftpindex/data' directory does not exists. mkdir...
# /ftpindex.sh -a ftp.gtk.org
# ./ftpindex.sh
doing ftp.gtk.org
`/root/ftpindex/data/ftp.gtk.org' directory does not exists. mkdir...
#
The data (file listing) are saved in $DATADIR/$ftp/$date
where $date is the date when the site indexing start in time_t
time_t's. (seconds since de UN*X epoch)
(you can track the indexing by:
# tail -f $DATADIR/$ftp/$date
)
The file lists file is in this format:
<bytes> <ctime time_t> <mode_t> <path/file>
when the site indexing is finished
$DATADIR/$ftp/list points to the file of the last scan and
$DATADIR/$ftp/list.old to the file of the last-last scan and
$DATADIR/$ftp/diff.$date with the diff
Comments, bugs?
Mail me. juam (at the server) users /dot/ sourceforge /dot/ net
MADE IN ARGENTINA
Generated on Sat, 11 Feb 2006 21:18:41 -0300
|
|