fossilcons 18 KB

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