fossilcons 18 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163
  1. .TH FOSSILCONS 8
  2. .SH NAME
  3. fossilcons \- fossil console commands
  4. .SH SYNOPSIS
  5. .B
  6. con /srv/fscons
  7. .PP
  8. .PD 0.1
  9. .B .
  10. .I file
  11. .PP
  12. .B 9p
  13. .I T-message
  14. ...
  15. .PP
  16. .B bind
  17. [
  18. .B -b|-a|-c|-bc|-ac
  19. ]
  20. .I new
  21. .I old
  22. .PP
  23. .B dflag
  24. .PP
  25. .B echo
  26. [
  27. .B -n
  28. ]
  29. [
  30. .I arg
  31. ...
  32. ]
  33. .PP
  34. .B listen
  35. [
  36. .B -INd
  37. ]
  38. [
  39. .I address
  40. ]
  41. .PP
  42. .B msg
  43. [
  44. .B -m
  45. .I nmsg
  46. ]
  47. [
  48. .B -p
  49. .I nproc
  50. ]
  51. .PP
  52. .B srv
  53. [
  54. .B -APWdp
  55. ]
  56. .I name
  57. .PP
  58. .B uname
  59. .I name
  60. [
  61. .I id
  62. |
  63. .BI : id
  64. |
  65. .BI % newname
  66. |
  67. .BI = leader
  68. |
  69. .BI + member
  70. |
  71. .BI - member
  72. ]
  73. .PP
  74. .B users
  75. [
  76. .B -dw
  77. |
  78. .I file
  79. ]
  80. .PP
  81. .B who
  82. .sp
  83. .PP
  84. .B fsys
  85. .I name
  86. .PP
  87. .B fsys
  88. .I name
  89. .B config
  90. .I device
  91. .PP
  92. .B fsys
  93. .I name
  94. .B venti
  95. [
  96. .I host
  97. ]
  98. .PP
  99. .B fsys
  100. .I name
  101. .B open
  102. [
  103. .B -APVWr
  104. ]
  105. [
  106. .B -c
  107. .I ncache
  108. ]
  109. .PP
  110. [
  111. .B fsys
  112. .I name
  113. ]
  114. .B close
  115. .PP
  116. .B fsys
  117. .I name
  118. .B unconfig
  119. .sp
  120. .PP
  121. [
  122. .B fsys
  123. .I name
  124. ]
  125. .B bfree
  126. .I addr
  127. .PP
  128. [
  129. .B fsys
  130. .I name
  131. ]
  132. .B block
  133. .I addr
  134. .I offset
  135. [
  136. .I count
  137. [
  138. .I data
  139. ]]
  140. .PP
  141. [
  142. .B fsys
  143. .I name
  144. ]
  145. .B check
  146. [
  147. .B pblock
  148. ] [
  149. .B pdir
  150. ] [
  151. .B pfile
  152. ] [
  153. .B bclose
  154. ] [
  155. .B clri
  156. ] [
  157. .B clre
  158. ] [
  159. .B clrp
  160. ]
  161. .br
  162. \h'1.5i'
  163. [
  164. .B fix
  165. ] [
  166. .B venti
  167. ] [
  168. .B snapshot
  169. ]
  170. .PP
  171. [
  172. .B fsys
  173. .I name
  174. ]
  175. .B clre
  176. .I addr
  177. .I offsets
  178. \&...
  179. .PP
  180. [
  181. .B fsys
  182. .I name
  183. ]
  184. .B clri
  185. .I files
  186. \&...
  187. .PP
  188. [
  189. .B fsys
  190. .I name
  191. ]
  192. .B clrp
  193. .I addr
  194. .I offset
  195. \&...
  196. .PP
  197. [
  198. .B fsys
  199. .I name
  200. ]
  201. .B create
  202. .I path
  203. .I uid
  204. .I gid
  205. .I perm
  206. .PP
  207. [
  208. .B fsys
  209. .I name
  210. ]
  211. .B df
  212. .PP
  213. [
  214. .B fsys
  215. .I name
  216. ]
  217. .B epoch
  218. [
  219. .B -ry
  220. ]
  221. .I n
  222. .PP
  223. [
  224. .B fsys
  225. .I name
  226. ]
  227. .B halt
  228. .PP
  229. [
  230. .B fsys
  231. .I name
  232. ]
  233. .B label
  234. .I addr
  235. [
  236. .I type
  237. .I state
  238. .I epoch
  239. .I epochclose
  240. .I tag
  241. ]
  242. .PP
  243. [
  244. .B fsys
  245. .I name
  246. ]
  247. .B remove
  248. .I files
  249. \&...
  250. .PP
  251. [
  252. .B fsys
  253. .I name
  254. ]
  255. .B snap
  256. [
  257. .B -a
  258. ]
  259. [
  260. .B -s
  261. .I src
  262. ]
  263. [
  264. .B -d
  265. .I dst
  266. ]
  267. .PP
  268. [
  269. .B fsys
  270. .I name
  271. ]
  272. .B snapclean
  273. [
  274. .I timeout
  275. ]
  276. .PP
  277. [
  278. .B fsys
  279. .I name
  280. ]
  281. .B snaptime
  282. [
  283. .B -a
  284. .I hhmm
  285. ]
  286. [
  287. .B -s
  288. .I interval
  289. ]
  290. [
  291. .B -t
  292. .I timeout
  293. ]
  294. .PP
  295. [
  296. .B fsys
  297. .I name
  298. ]
  299. .B stat
  300. .IR files ...
  301. .PP
  302. [
  303. .B fsys
  304. .I name
  305. ]
  306. .B sync
  307. .PP
  308. [
  309. .B fsys
  310. .I name
  311. ]
  312. .B unhalt
  313. .PP
  314. [
  315. .B fsys
  316. .I name
  317. ]
  318. .B vac
  319. .I dir
  320. .PP
  321. [
  322. .B fsys
  323. .I name
  324. ]
  325. .B wstat
  326. .I file
  327. .I elem
  328. .I uid
  329. .I gid
  330. .I perm
  331. .I length
  332. .SH DESCRIPTION
  333. These are configuration and maintenance commands
  334. executed at the console of a
  335. .IR fossil (4)
  336. file server.
  337. The commands are split into three groups above:
  338. file server configuration,
  339. file system configuration,
  340. and file system maintenance.
  341. This manual page is split in the same way.
  342. .SS File server configuration
  343. .PP
  344. The
  345. dot
  346. .RI ( . )
  347. command
  348. reads
  349. .IR file ,
  350. treating each line as a command to be executed.
  351. Blank lines and lines beginning with a
  352. .L #
  353. character are ignored.
  354. Errors during execution are printed but do not stop the script.
  355. Note that
  356. .I file
  357. is a file in the name space in which
  358. .I fossil
  359. was started,
  360. .I not
  361. a file in any file system served by
  362. .IR fossil .
  363. .PP
  364. .I 9p
  365. executes a 9P transaction; the arguments
  366. are in the same format used by
  367. .IR 9pcon (8).
  368. .PP
  369. .I Bind
  370. behaves similarly to
  371. .IR bind (1).
  372. It is useful when fossil
  373. is started without devices it needs configured
  374. into its namespace.
  375. .PP
  376. .I Dflag
  377. toggles the debug flag and prints the new setting.
  378. When the debug flag is set, all protocol messages
  379. and information about authentication is printed to
  380. standard error.
  381. .PP
  382. .I Echo
  383. behaves identically to
  384. .IR echo (1),
  385. writing to the console.
  386. .PP
  387. .I Listen
  388. manages the network addresses at which
  389. fossil is listening.
  390. With no arguments,
  391. .I listen
  392. prints the current list of addresses and their network directories.
  393. With one argument, listen
  394. .I address
  395. starts a new listener at
  396. .IR address ;
  397. the
  398. .B -d
  399. flag causes
  400. .I listen
  401. to remove the listener
  402. at the given address.
  403. By default, the user
  404. .I none
  405. is only allowed to attach on a connection after
  406. at least one other user has successfully attached.
  407. The
  408. .B -N
  409. flag allows connections from
  410. .I none
  411. at any time.
  412. The
  413. .B -I
  414. flag causes
  415. .I fossil
  416. to check the IP address of incoming connections
  417. against
  418. .BR /mnt/ipok ,
  419. rejecting attaches from disallowed addresses.
  420. This mechanism is not intended for general use.
  421. The server
  422. .I sources.cs.bell-labs.com
  423. uses it to comply with U.S. crytography
  424. export regulations.
  425. .PP
  426. .I Msg
  427. prints the maximum internal 9P message queue size
  428. and the maximum number of 9P processes to
  429. allocate for serving the queue.
  430. The
  431. .B -m
  432. and
  433. .B -p
  434. options set the two variables.
  435. .PP
  436. .I Srv
  437. behaves like listen but uses
  438. .BI /srv/ name
  439. rather than a network address.
  440. With the
  441. .B -p
  442. flag,
  443. .I srv
  444. edits a list of console services rather than 9P services.
  445. With no arguments,
  446. .I srv
  447. prints the current list of services.
  448. With one argument, srv
  449. .I name
  450. starts a new service at
  451. .IR /srv/name ;
  452. the
  453. .B -d
  454. flag causes
  455. .I srv
  456. to remove the named service.
  457. See the
  458. .I [fsys] open
  459. command below for a description of the
  460. .B -APW
  461. options.
  462. .PP
  463. .I Uname
  464. manipulates entries in the user table.
  465. There is no distinction between users and groups:
  466. a user is a group with one member.
  467. For each user, the user table records:
  468. .TP
  469. .I id
  470. the string used to represent this user in the on-disk structures
  471. .TP
  472. .I name
  473. the string used to represent this user in the 9P protocol
  474. .TP
  475. .I leader
  476. the group's leader (see
  477. .IR stat (5)
  478. for a description of the special privileges held by a group leader)
  479. .TP
  480. .I members
  481. a comma-separated list of members in this group
  482. .PP
  483. The
  484. .I id
  485. and
  486. .I name
  487. are usually the same string, but need not be.
  488. Once an
  489. .I id
  490. is used in file system structures archived to Venti,
  491. it is impossible to change those disk structures,
  492. and thus impossible to rename the
  493. .IR id .
  494. The translation from
  495. .I name
  496. to
  497. .I id
  498. allows the appearance of renaming the user even
  499. though the on-disk structures still record the old name.
  500. (In a conventional Unix file system, the
  501. .I id
  502. is stored as a small integer rather than a string.)
  503. .I Leader
  504. and
  505. .I members
  506. are names, not ids.
  507. .PP
  508. The first argument to
  509. .I uname
  510. is the
  511. .I name
  512. of a user.
  513. The second argument is a verb, one of:
  514. .TP
  515. .I id
  516. create a user with name
  517. .RI ` name '
  518. and id
  519. .RI ` id ;'
  520. also create a home directory
  521. .BI /active/usr/ uname \fR
  522. .TP
  523. .BI : id
  524. create a user with name
  525. .RI ` name '
  526. and id
  527. .RI ` id ,'
  528. but do not create a home directory
  529. .TP
  530. .BI % newname
  531. rename user
  532. .RI ` name '
  533. to
  534. .RI ` newname ,'
  535. throughout the user table
  536. .TP
  537. .BI = leader
  538. set
  539. .IR name 's
  540. group leader
  541. to
  542. .IR leader .
  543. .TP
  544. .BI =
  545. remove
  546. .IR name 's
  547. group leader; then all members will be
  548. considered leaders
  549. .TP
  550. .BI + member
  551. add
  552. .I member
  553. to
  554. .IR name 's
  555. list of members
  556. .TP
  557. .BI - member
  558. remove
  559. .I member
  560. from
  561. .IR name 's
  562. list of members
  563. .LP
  564. If the verb is omitted, the entire entry for
  565. .I name
  566. is printed, in the form
  567. `\fIid\fL:\fIname\fL:\fIleader\fL:\fImembers\fR.'
  568. .LP
  569. The end of this manual page gives examples.
  570. .PP
  571. .I Users
  572. manipulates the user table.
  573. The user table is a list of lines in the form printed
  574. by the
  575. .I uname
  576. command.
  577. The
  578. .B -d
  579. flag resets the user table with the default:
  580. .IP
  581. .EX
  582. adm:adm:adm:sys
  583. none:none::
  584. noworld:noworld::
  585. sys:sys::
  586. glenda:glenda:glenda:
  587. .EE
  588. .PP
  589. Except
  590. .BR glenda ,
  591. these users are mandatory: they must appear in all user
  592. files and cannot be renamed.
  593. .PP
  594. The
  595. .B -r
  596. flag reads a user table from the named
  597. .I file
  598. in file system
  599. .BR main .
  600. The
  601. .B -w
  602. flag writes the table to
  603. .B /active/adm/users
  604. on the file system
  605. .BR main .
  606. .B /active/adm
  607. and
  608. .B /active/adm/users
  609. will be created if they do not exist.
  610. .PP
  611. .I Users
  612. .B -r
  613. .B /active/adm/users
  614. is automatically executed when the file system
  615. .B main
  616. is opened.
  617. .PP
  618. .I Users
  619. .B -w
  620. is automatically executed after each change to the user
  621. table by the
  622. .I uname
  623. command.
  624. .PP
  625. .I Who
  626. prints a list of users attached to each active connection.
  627. .SS File system configuration
  628. .I Fsys
  629. sets the current file system to
  630. .IR name ,
  631. which must be configured and open (q.v.).
  632. The current file system name is
  633. displayed as the file server prompt.
  634. The special name
  635. .B all
  636. stands for all file systems;
  637. commands applied to
  638. .B all
  639. are applied to each file system in turn.
  640. The commands
  641. .BR config ,
  642. .BR open ,
  643. .BR venti ,
  644. and
  645. .B close
  646. cannot be applied to
  647. .BR all .
  648. .PP
  649. .I Fsys
  650. takes as an optional argument
  651. (after
  652. .BR name )
  653. a command to execute on the named file system.
  654. Most commands require that the named file system
  655. be configured and open; these commands can be invoked
  656. without the
  657. .BI fsys " name
  658. prefix, in which case the current file system is used.
  659. A few commands
  660. .RB ( config ,
  661. .BR open ,
  662. and
  663. .BR unconfig )
  664. operate on unopened file systems; they require the prefix.
  665. .PP
  666. .I Config
  667. creates a new file system named
  668. .I name
  669. using disk file
  670. .I device .
  671. This just adds an entry to fossil's internal table.
  672. .PP
  673. .I Venti
  674. establishes a connection to the Venti server
  675. .I host
  676. (by default, the environment variable
  677. .B $venti
  678. or the network variable
  679. .BR $venti )
  680. for use by the named file system.
  681. If no
  682. .I venti
  683. command is issued before
  684. .IR open ,
  685. the default Venti server will be used.
  686. If the file system is open,
  687. and was not opened with the
  688. .B -V
  689. flag,
  690. the command redials the Venti server.
  691. This can be used to reestablish broken connections.
  692. It is not a good idea to use the command to switch
  693. between Venti servers, since Fossil does not keep track
  694. of which blocks are stored on which servers.
  695. .PP
  696. .I Open
  697. opens the file system, reading the
  698. root and super blocks and allocating an in-memory
  699. cache for disk and Venti blocks.
  700. The options are:
  701. .TP
  702. .B -A
  703. run with no authentication
  704. .TP
  705. .B -P
  706. run with no permission checking
  707. .TP
  708. .B -V
  709. do not attempt to connect to a Venti server
  710. .TP
  711. .B -W
  712. allow wstat to make arbitrary changes to the user and group fields
  713. .TP
  714. .B -r
  715. open the file system read-only
  716. .TP
  717. .BI -c " ncache
  718. allocate an in-memory cache of
  719. .I ncache
  720. (by default, 1000)
  721. blocks
  722. .PP
  723. The
  724. .I -APW
  725. settings can be overridden on a per-connection basis
  726. by the
  727. .I srv
  728. command above.
  729. .PP
  730. .I Close
  731. flushes all dirty file system blocks to disk
  732. and then closes the device file.
  733. .PP
  734. .I Unconfig
  735. removes the named file system (which must be closed)
  736. from fossil's internal table.
  737. .SS File system maintenance
  738. .I Bfree
  739. marks the block at disk address
  740. .I addr
  741. as available for allocation.
  742. Before doing so, it prints a
  743. .I label
  744. command (q.v.)
  745. that can be used to restore the block to its previous state.
  746. .PP
  747. .I Block
  748. displays (in hexadecimal)
  749. the contents of the block at disk address
  750. .IR addr ,
  751. starting at
  752. .I offset
  753. and continuing for
  754. .I count
  755. bytes or until the end of the block.
  756. If
  757. .I data
  758. (also hexadecimal)
  759. is given, the contents in that range are
  760. replaced with data.
  761. When writing to a block,
  762. .I block
  763. prints the old and new contents,
  764. so that the change is easily undone.
  765. Editing blocks is discouraged.
  766. .PP
  767. .I Clre
  768. zeros an entry from a disk block.
  769. Before doing so, it prints a
  770. .I block
  771. command that can be used
  772. to restore the entry.
  773. .PP
  774. .I Clri
  775. removes the internal directory entry
  776. and abandons storage associated with
  777. .IR files .
  778. It ignores the usual rules for sanity, such as checking against
  779. removing a non-empty directory.
  780. A subsequent
  781. .I flchk
  782. (see
  783. .IR fossil (4))
  784. will identify the abandoned storage so it can be reclaimed with
  785. .I bfree
  786. commands.
  787. The
  788. .I perm
  789. is formatted as described in the
  790. .I stat
  791. command ;
  792. creating files or directories with the
  793. snapshot
  794. .RB ( s )
  795. bit set is not allowed.
  796. .PP
  797. .I Clrp
  798. zeros a pointer in a disk block.
  799. Before doing so, it prints a
  800. .I block
  801. command that can be used to restore the entry.
  802. .PP
  803. .I Check
  804. checks the file system for various inconsistencies.
  805. If the file system is not already halted, it is halted for
  806. the duration of the check.
  807. If the archiver is currently sending a snapshot to Venti,
  808. the check will refuse to run; the only recourse is to wait
  809. for the archiver to finish.
  810. .PP
  811. A list of keyword options control the check.
  812. The
  813. .BR pblock ,
  814. .BR pdir ,
  815. and
  816. .B pfile
  817. options cause
  818. .I check
  819. to print the name of each block, directory, or file encountered.
  820. .PP
  821. By default,
  822. .I check
  823. reports errors but does not fix them.
  824. The
  825. .BR bclose ,
  826. .BR clri ,
  827. .BR clre ,
  828. and
  829. .B clrp
  830. options specify correcting actions that may be taken:
  831. closing leaked blocks, clearing bad file directory entries,
  832. clearing bad pointers, and clearing bad entries.
  833. The
  834. .B fix
  835. option enables all of these; it is equivalent to
  836. .B bclose
  837. .B clri
  838. .B clre
  839. .BR clrp .
  840. .PP
  841. By default,
  842. .I check
  843. scans the portion of the active file system held in the write buffer,
  844. avoiding blocks stored on Venti or used only in snapshots.
  845. The
  846. .B venti
  847. option causes
  848. .I check
  849. to scan the portion of the file system stored on Venti,
  850. and the
  851. .B snapshot
  852. option causes
  853. .I check
  854. to scan old snapshots.
  855. Specifying
  856. .B snapshot
  857. causes
  858. .I check
  859. to take a long time;
  860. specifying
  861. .B venti
  862. or
  863. (worse)
  864. .B venti
  865. .B snapshot
  866. causes
  867. .I check
  868. to take a very long time.
  869. .PP
  870. .I Create
  871. creates a file on the current file system.
  872. .I Uid
  873. and
  874. .I gid
  875. are uids
  876. .RI ( not
  877. unames;
  878. see the discussion above, in the description
  879. of the
  880. .I uname
  881. command).
  882. .I Perm
  883. is the low 9 bits of the permission mode of the file,
  884. in octal.
  885. The
  886. .BR a ,
  887. .BR d ,
  888. and
  889. .B l
  890. mode prefixes
  891. set the append-only, directory, and lock bits.
  892. .PP
  893. .I Df
  894. prints the amount of used disk space in the write buffer.
  895. .PP
  896. .I Epoch
  897. sets the low file system epoch.
  898. Snapshots in the file system are given increasing epoch numbers.
  899. The file system maintains a low and a high epoch number,
  900. and only allows access to snapshots in that range.
  901. The low epoch number can be moved forward to discard old snapshots
  902. and reclaim the disk space they occupy.
  903. (The high epoch number is always the epoch of the currently
  904. active file system.)
  905. .PP
  906. The command
  907. ``\fLepoch\fI n''\fR
  908. is used to propose changing the low epoch to
  909. .IR n .
  910. In response,
  911. .I fossil
  912. scans
  913. .B /archive
  914. and
  915. .B /snapshot
  916. for snapshots that would be discarded, printing their
  917. epoch numbers and the
  918. .I clri
  919. commands necessary to remove them.
  920. The epoch is changed only if no such paths are found.
  921. The usual sequence of commands is (1) run epoch to
  922. print the snapshots and their epochs, (2) clri some snapshots,
  923. (3) run epoch again.
  924. If the file system is completely full (there are no free blocks),
  925. .I clri
  926. may fail because it needs to allocate blocks.
  927. For this situation,
  928. the
  929. .B -y
  930. flag to epoch forces the epoch change even when
  931. it means discarding currently accessible snapshots.
  932. Note that when there are still snapshots in
  933. .BR /archive ,
  934. the archiver should take care
  935. of those snapshots (moving the blocks from disk to Venti)
  936. if you give it more time.
  937. .PP
  938. The
  939. .B -r
  940. flag to epoch causes it to remove any now-inaccessible
  941. snapshot directories once it has changed the epoch.
  942. This flag only makes sense in conjunction with the
  943. .B -y
  944. flag.
  945. .PP
  946. .I Epoch
  947. is a very low-level way to retire snapshots.
  948. The preferred way is by setting an automatic timer
  949. with
  950. .IR snaptime .
  951. .PP
  952. .I Halt
  953. suspends all file system activity;
  954. .I unhalt
  955. resumes activity.
  956. .PP
  957. .I Label
  958. displays and edits the label associated with a block.
  959. When editing, a parameter of
  960. .B -
  961. means leave that field unchanged.
  962. Editing labels is discouraged.
  963. .PP
  964. .I Remove
  965. removes
  966. .IR files .
  967. .PP
  968. .I Snap
  969. takes a temporary snapshot of the current file system,
  970. recording it in
  971. .BI /snapshot/ yyyy / mmdd / hhmm \fR,
  972. as described in
  973. .IR fossil (4).
  974. The
  975. .B -a
  976. flag causes
  977. .I snap
  978. to take an archival snapshot, recording it in
  979. .BI /archive/ yyyy / mmdd \fR,
  980. also described in
  981. .IR fossil (4).
  982. By default the snapshot is taken of
  983. .BR /active ,
  984. the root of the active file system.
  985. The
  986. .B -s
  987. flag specifies a different source path.
  988. The
  989. .B -d
  990. flag specifies a different destination path.
  991. These two flags are useful together for moving snapshots into
  992. the archive tree.
  993. .PP
  994. .I Snapclean
  995. immediately discards all snapshots that are more than
  996. .I timeout
  997. minutes old.
  998. The default timeout is the one set by the
  999. .I snaptime
  1000. command.
  1001. The discarding is a one-time event rather than
  1002. a recurring event as in
  1003. .IR snaptime .
  1004. .PP
  1005. .I Snaptime
  1006. displays and edits the times at which snapshots are automatically
  1007. taken.
  1008. An archival snapshot is taken once a day, at
  1009. .IR hhmm ,
  1010. while temporary snapshots are taken at multiples of
  1011. .I interval
  1012. minutes.
  1013. Temporary snapshots are discarded after they are
  1014. .I timeout
  1015. minutes old.
  1016. The snapshot cleanup runs every
  1017. .I timeout
  1018. minutes or once a day, whichever is more frequent,
  1019. so snapshots may grow to an age of almost twice the timeout
  1020. before actually being discarded.
  1021. With no arguments,
  1022. .I snaptime
  1023. prints the current snapshot times.
  1024. The
  1025. .B -a
  1026. and
  1027. .B -s
  1028. options set the archive and snapshot times.
  1029. An
  1030. .I hhmm
  1031. or
  1032. .I interval
  1033. of
  1034. .L none
  1035. can be used to disable that kind of automatic snapshot.
  1036. The
  1037. .B -t
  1038. option sets the snapshot timeout.
  1039. If
  1040. .I timeout
  1041. is
  1042. .LR none ,
  1043. temporary snapshots are not automatically discarded.
  1044. By default, all three times are set to
  1045. .LR none .
  1046. .PP
  1047. .I Stat
  1048. displays metadata for each of the named
  1049. .IR files ,
  1050. in the form:
  1051. .IP
  1052. .EX
  1053. stat \fIfile elem uid gid perm length
  1054. .EE
  1055. .LP
  1056. (Replacing
  1057. .B stat
  1058. with
  1059. .B wstat
  1060. yields a valid command.)
  1061. The
  1062. .I perm
  1063. is an octal number less than or equal to 777,
  1064. prefixed with any of the following letters
  1065. to indicate additional bits.
  1066. .IP
  1067. .EX
  1068. .ta +4n
  1069. a \fRappend only
  1070. d \fRdirectory
  1071. l \fRexclusive use
  1072. s \fRis the root of a snapshot
  1073. t \fRtemporary bit
  1074. A \fRMS-DOS archive bit
  1075. G \fRsetgid
  1076. H \fRMS-DOS hidden bit
  1077. L \fRsymbolic link
  1078. S \fRMS-DOS system bit
  1079. U \fRsetuid
  1080. Y \fRsticky
  1081. .EE
  1082. The bits denoted by capital letters are included
  1083. to support non-Plan 9 systems.
  1084. They are not made visible by the 9P protocol.
  1085. .PP
  1086. .I Sync
  1087. writes dirty blocks in memory to the disk.
  1088. .PP
  1089. .I Vac
  1090. prints the Venti score for a
  1091. .IR vac (1)
  1092. archive containing the tree rooted
  1093. at
  1094. .IR dir ,
  1095. which must already be archived to Venti
  1096. (typically
  1097. .IR dir
  1098. is a directory in the
  1099. .B /archive
  1100. tree).
  1101. .PP
  1102. .I Wstat
  1103. changes the metadata of the named
  1104. .IR file .
  1105. Specifying
  1106. .B -
  1107. for any of the fields means ``don't change.''
  1108. Attempts to change the
  1109. .B d
  1110. or
  1111. .B s
  1112. bits in the
  1113. .I perm
  1114. are silently ignored.
  1115. .SH EXAMPLES
  1116. .IR Sources ,
  1117. the Plan 9 distribution file server,
  1118. uses the following configuration file:
  1119. .IP
  1120. .EX
  1121. srv -p fscons.sources
  1122. srv -p fscons.sources.adduserd
  1123. srv sources
  1124. fsys main config /dev/sdC0/fossil.outside
  1125. fsys main open -c 25600
  1126. fsys main
  1127. users /active/adm/users
  1128. listen tcp!*!564
  1129. msg -m 40 -p 10
  1130. snaptime -a 0000 -s 15
  1131. .EE
  1132. .LP
  1133. The second console is used by the daemon
  1134. that creates new accounts.
  1135. .PP
  1136. To add a new user with
  1137. .I name
  1138. and
  1139. .I id
  1140. .B rob
  1141. and create his home directory:
  1142. .IP
  1143. .EX
  1144. uname rob rob
  1145. .EE
  1146. .PP
  1147. To create a new group
  1148. .B sys
  1149. (with no home directory)
  1150. and add
  1151. .B rob
  1152. to it:
  1153. .IP
  1154. .EX
  1155. uname sys :sys
  1156. uname sys +rob
  1157. .EE
  1158. .PP
  1159. To save an old (but not yet discarded) snapshot into the archive tree:
  1160. .IP
  1161. .EX
  1162. snap -a -s /snapshot/2003/1220/0700 -d /archive/2003/1220
  1163. .EE