fossilcons 18 KB

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