Last update 26-Aug-2005
mbfile - File database maintenance program.
Synopsys.
mbfile [commands] <options>
Description.
mbfile is the filedatabase maintenance program for mbsebbs. In order to run mbfile you must have started mbsed, this is the deamon which controls all bbs activities.
The main purpose of mbfile to do automatic maintenance on the downloadable files on the bbs, such as removing or moving old files, checking the database and packing the database. The best way to do the maintenance is to run mbfile from the crontab. example:
30 05 * * * export MBSE_ROOT=/opt/mbse; /opt/mbse/bin/mbfile kill pack index -quietOther functions in mbfile are meant to do manual maintenance such as adding, deleting or moving files.
Environment.
In order to run the bbs you need to set one global environment variable $MBSE_ROOT This variable must point to the root of the bbs directoy structure. The main configuration file config.data must exist in the subdirectory ~/etc.
Commands.
mbfile adopt <area> <file> [description]
Adopt a file to the filebase. The description is optional, but if present it should be enclosed in quotes. The optional description may be 255 characters. Default mbfile will try to use the FILE_ID.DIZ if this is present. The file to adopt needs to be in your current directory and will be copied to the new area. If you have virus scanners defined, the file will be checked for virusses.
mbfile check [area]
Check the database integrity. All files in the filedatabase must exist on disk and all files on disk must exist in the filedatabase. There are some exceptions, files.bbs, files.bak, 00index, index*.html, header, readme and files that start with a dot. Of all files the date and time is checked, the size and the crc value of the file. If there is something wrong, the error is corrected or the file is removed. If the area is a CD-rom area, the check that files on disk must exist in the filedatabase is skipped. If no area number is given, all areas are checked.
mbfile delete <area> "<filemask>"
Mark file(s) in an area for later deletion. You can use wildcards, and if you do surround them with quotes to prevent shell expansion. The file is not removed until you run mbfile pack.
mbfile import <area>
Import files to the given area using files.bbs descriptions. There are two possibilities, import from CD-rom or just from a temporary directory.To start the import, type
- Import from a temporary directory: Put the files to import there including the files.bbs file.
- Import from CD-rom: Go into the directory on the CD where the files are. If the files.bbs is not in the same directory, you must enter the full filename and path where the files.bbs is with mbsetup 8.4.area.6.
mbfile import area
where area is the number of the destination filearea. The files are not checked for FILE_ID.DIZ inside the archives. If you have virus scanners defined, the files are checked for virusses before they are added the the bbs. If you don't want these fresh files to be announced, add the-announce
option on the commandline. This may be a good idea if you migrate from another bbs system.
mbfile index
Create fast filerequest index for the mbcico filerequest processor. In each directory with the downloadable files is also a files.bbs file written in msdos cr/lf format. This includes a download counter. Also, if defined, in each available download area for ftp/http, 00index and index.html files are created, starting at the ftp pub directory. If the area contains gif or jpg images, thumbnails are created using the convert program if you have that installed. The thumbnails have the same filenames as the original images, only they start with a dot. The convert command is defined with mbsetup menu 1.19.8, if you don't have it or don't want thumbnails, make that entry empty. The index command only rebuilds area index files (files.bbs, index.html and 00index) when there was a change in the area.
mbfile kill
Mark files to delete or move files in areas that have the download age set or the filedate age set. A setting of 0 is ignored. Areas on CD-rom are always skipped. If the Move to Area option is set the files are moved to the given area. The upload date and download date are reset to the current date and time. So if you set in the destination area aging of 14 days, files will stay there for 14 days after the move. This is good for automatic "last chance" areas.
mbfile list [area]
List all defined file areas, the number of files, the total size of the files and the primary group. If and area is given on the commandline, the files in that area are listed.
mbfile move <from> <to> <file>
This command will move a file from one area to another. No actions on the file are performed.
mbfile pack
This command will actualy remove the records of files that are marked for deletion. If the file is still on disk, it will be removed also. So when you delete files with mbsetup or with mbfile, they are still in your database and on disk until you run mbfile pack.
mbfile rearc <area> "<filemask>"
; Re-archive file(s) in an file area to the archiver that must be set in the file area setup.
mbfile sort <area>
Sort the files in area on the long filenames. The sort is case insensitive. When the sort is completed, the command mbfile index will automatic run to rebuild all indexes.
mbfile toberep
Shows which files are to be reported. This lists only the files that are received during .tic processing, new uploaded files are not displayed. This list is automatic removed after newfiles are announced. See also mbtoberep.
mbfile undelete <area> "<filemask>"
Mark a file that is marked for deletion to be available again, ie. undo the deletion mark. You can use wildcards, and if you do surround them with quotes to prevent shell expansion.
Options.
mbfile [command] -quiet
Quiet mode, no screen output. Use this switch if you run mbfile from the crontab.
mbfile [command] -announce
Announce mode, use this switch with the adopt and import commands to prevent that the added file(s) will be announced. This can be usefull if you add lots of files that you don't want to announce these as new files.