1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830
|
Programs of AF's backup system
==============================
Programs of the server side
---------------------------
$BASEDIR/server/bin/cartis
Administration of the cartridge numbers. Usage:
cartis <number>
cartis -i <ins-cart> <ins-file> [ -S <cartset> ]
The first form of this command is used to give the backup
server a hint, which cartridge number is currently placed inside
the streamer. If the tape has a valid afbackup label, then it
is not necessary to tell the server, what tape is in the drive,
cause it will try to read and evaluate it. If the tape is not
labeled (e.g. if it has not been used before), the server has
no chance to find out the number and must maintain it's own
information about it. The server will automatically label new
tapes, if they don't already have a valid label, the next time,
a write operation is attempted on the tape. By issuing cartis
after inserting an unlabeled tape you tell the server, what
tape it should become. If you are not initially starting with
cartridge number 1 and an unlabeled tape, you have to enter this
command at least one time. (see: README, "BEFORE YOU START")
if you have not labeled a tape or variable append mode is on.
The second form instructs the server to write the next backup
data stream to cartridge number <ins-cart>, starting at file
number <ins-file>. This is useful, if for some reason you want
to take the cartridge currently lying inside the drive out and
continue on a different tape or at the beginning of the tape
you have put in instead. Note, that it usually causes problems,
if you try to write at a tape position, that is not at the end
of the last file, that has been written to tape. So set the
<ins-file> number only to a value different from 1, if you
really know, that this is the end of the used tape area. In
other words, if n files are on tape, set <ins-file> to n+1. So
if you don't know n, you're better off starting to write at the
beginning of a new tape entering the appropriate cartis-command.
To find out, what the server is thinking, which cartridge is
currently inside the drive, you can give the command
$BASEDIR/client/bin/afclient -q on any client. If the value, that
is printed out, does not reflect the reality, you have to inform
the backup server about this fact via this command entering both
forms of this command. The first form with the real cartridge
number and the second one with the next cartridge number and a 1
as file number. Then the next backup goes to the next cartridge.
You may also set the next backup writing position to the current
file number on the correct cartridge. To find out, where the
server side intents to write the next backup, enter the command
$BASEDIR/client/bin/afclient -Q on any client.
It makes sense to check the consistency from time to time, if
the backup server has the right idea of the current cartridge.
-S <cartset> The cartridge set to use, where <cartset> is the
number of a valid cartridge set on the server
side. Default is 1
$BASEDIR/server/bin/cartready
(No arguments evaluated)
If you have no cartridge handling system, a human must put the
next cartridge into the drive, if necessary. Then the backup-
server must get a hint, when the maintainer has done it. This
is achieved entering this command on the backup server host,
after the new cartridge is inserted. Nonetheless the server
process waits a certain timespan, until it accesses the drive
the next time (See: "Cart-Insert-Gracetime" in CONFIG).
$BASEDIR/server/bin/label_tape
Write a label to tape or display it. Usage:
label_tape <label-number> [ -rfF ] [ -c <configfile> ] \
[ -S <sec-label-number ] [ -n <comment> ] \
[ -d <devicename> ] [ -b <blocksize> ] \
[ -s <set-file-cmd> ] [ -C <num-cartridges> ]
label_tape -q [ -c <configfile> ] [ -d <devicename> ] \
[ -b <blocksize> ] [ -s <set-file-cmd> ]
The first form writes a label to the tape, the second form shows
the label on the tape, that is currently loaded.
The tape-label must be an integer number. This number is written
to the tape currently in the drive and identifies it uniquely. It
must be in the range from 1 to the number of cartridges given in
the configuration file. This label is written at the beginning
of the tape, so all data on tape will be lost. Due to that fact
the user is always prompted, if he really wants to do this.
<config-file> can be a different configuration file than the one
the server process is started with. Normally it makes no sense
to use this option, but in extremely pathological cases the
program might not be able to find out the full path to the
configuration file. Then is has to be supplied at the command
line.
The normal case is to use this command without options, but the
settings in the serverside configuration file can be overridden,
if necessary.
If it is intended to label a tape, while a server is waiting for
another cartridge being put into the drive, the -F option must
be used to override the lock, that is held by the server process.
The server will be kept from probing, whether a tape is in the
drive, while the label_tape program is running. label_tape
should be started, before the tape to be labeled is put into the
drive. Otherwise the server might eject it at once after probing.
label_tape will prompt for confirmation before performing any
tape access (if started without -f option). Thus the tape should
be loaded after starting the command and before confirming.
-b <blocksize> The blocksize of the device to use
-C <num-carts> The total number of handled cartridges
-c <configfile> A different configuration file to use
-d <devicename> The device to use
-f Force operation without further asking
-F Continue regardless of a lock, probably set
by other running applications, especially
the server. This option may be used to label
a tape, while the server is waiting for a
cartridge to be put into the streamer device
-n <comment> A comment to include into the tape label
(256 characters max)
-r Remove the cartridge in the drive from the
cartridge handling database without further
asking
-S <sec-label> The secondary label number, the server will
accept, if the primary label number does
not match
-s <setf-cmd> The command to reel the tape to a given
file position
$BASEDIR/server/bin/cart_ctl
Perform operations on tapes: move, set location, inventory, list
locations, label several tapes in changer slots, drives, loadbays
cart_ctl [ -ilmtefF ] [ -P [ <location> ] ] \
[ -s <serverconfigfile> ] \
[ -c <changerconfigfile> ] \
[ -d <changerdevice> ] [ -C <cartridges> ] \
[ -S [ <slots> ] ] [ -D [ <drives> ] ] \
[ -L [ <loadports> ] ] [ -b <blocksize> ] \
[ -n <comment> ]
This command performs operations on cartridges and maintains
the cartridge location database. This command is especially
designed for moving cartridges around, serving as a wrapper
for those commands, that in fact fulfil this functionality.
cart_ctl adds the maintenance of the locations and unifies
the command interface. E.g. the counting of slots, loadbays
and drives always starts with 1 here. Several cartridges,
slots, drives and loadbays can be supplied using numbers,
dashes and commas to the respective option, e.g. -C 3-5,8 .
The order is significant, e.g. -m -C 2-3,1 -S 5,4,3 will
move cartridge 2 to slot 5, 3 to 4 and 1 to slot 3. This
command evaluates the serverside configuration file and reads
another file to configure the media changer driving commands.
The path to this second configuration file must be given in
the server configuration file as parameter
Changer-Configuration-File
See below under FILES for more details on this.
With option -m, one or more cartridges are moved to another
location. The location must be specified with options -S for
slots, -D for drives, -L for loadbays and -P for a freetext
description, if the cartridge is placed outside of any
cartridge handling system. Thus the administrator can store
any kind of text as reminder, where the tapes are. If there
are no slots supplied with option -S, free slots are looked
up and the cartridge(s) move there. The same applies for -L.
If no drive is given with -D, the drive configured in the
server configuration file is used. The number of the drive
can be given, or the device name, but in the current version
just -D is mostly suitable. If there is a tape in the drive,
it will be unloaded to a free slot first. If occupied slots
or loadbays are given as targets, an error message is printed
and the move is not performed. If there is no argument given
with -P, the user is prompted to enter a line of text, that
is stored in the cartridge locations database. If several
cartridges are moved outside of a robot, the text given with
-P will be stored for all of them. If moving to loadbays is
possible, moves to the outside will first have a loadport as
target and the maintainer is asked to take the tape out of
this place to it's final destination. When moving tapes in
and there are loadbays, the maintainer is asked to put the
cartridge into a loadbay and the robot does the rest. If
there isn't yet any location stored for a cartridge, the
maintainer is asked to perform the move manually, naming the
origin location `unknown'.
Option -S can be used, if a location of a tape changes, but
it should not be moved by any robot. So -S just inserts or
replaces the new location in the database. To specify the
locations the same options can be used like when moving with
-m, see the previous section for details.
Option -l lists the locations of all cartridges. If -S is
also supplied, the contents of the slots are listed. A dash
means, that the slot is empty. A question mark means, that
there is a cartridge in this slot, but it is unknown, which
that might be. A dash, followed by a question mark and a
number, all in braces, means, that the slot is empty, but the
locations database has the given cartridge number stored for
this slot, what means an inconsistency. Option -L together
with -l has the respective meaning for loadbays like -S for
slots.
Option -i makes an inventory of the slots specified with -S.
That is, the cartridges in these slots are loaded to drive,
the labels are read and evaluated. If the label is recognized
as valid for afbackup, the location database is updated. The
cartridge will be put back to the original slot afterwards.
Option -t can be used to label the tapes in several slots.
The label numbers must be given using option -C and the slots
with option -S. If the label numbers are not given, it is
assumed, that the tapes should get the currently registered
numbers. If it cannot be determined, which cartridges are in
the given slots, this is an error. If the slots are not given,
it is tried to determine them from the given cartridge numbers.
If the given cartridges are currently not located in any slot,
this is an error. Like with the command label_tape, a comment
to be written to tape can be supplied with option -n.
Option -e makes the tape in the drive to be ejected to a free
slot. No tape number has to be supplied. Optionally the slot
can be specified using option -S.
Options:
-b override the blocksize setting in the server
configuration file (discouraged)
-C <cart> specify the cartridge numbers to operate on
-c <file> use the given file to configure the media changer
driving commands
-D <drive> use the given drive as target for moves or location
settings. The drive may be specified as number
inside a changer system (starting with 1) or as
device name. If no drive is given, the drive
configured in the server configuration file is
used
-d <dev> operate on the given media changer device, don't
use the settings in the configuration file
-F force operations, ignore active locks on streamer
and changer devices, if applicable
-f force labeling operations without further asking
-i inventory the cartridges in the slots specified
with -S
-l list the cartridge locations, together with -S:
list the contents of the slots (if no slots given:
of all slots), together with -L: list the contents
of loadports (specified or all)
-L <loadp> specify the loadports, that should be part of the
desired operation. If no loadports are given,
free ones are searched for when moving
-m perform moves of one or more cartridges. These
must be given using -C. Targets for the moves
must be given using -S for slots, -L for loadbays,
-D for drives or -P for somewhere else
-n <comm> use the given comment when labeling tapes with -t
-P <place> Specify the target place for moving or just setting
a cartridge location. If no place is given on the
command line, the program will prompt for one
-S <slots> Specify the slots, that should be part of the
desired operation. If no slots are given,
free ones are searched for when moving
-s <file> Use the given file as server configuration file, not
the default one
-t Write labels (`tags') to the cartridges in the slots
specified with -S
This command can be used as the SetCartridgeCommand in the
server configuration. Option -F is required here, cause the
server itself is already holding a lock on the streamer device,
thus this command needs not and should not attempt any further
locking. The entry in the server configuration file should look
like this:
/path/to/cart_ctl -F -m -C %n -D
Files:
A configuration file to specify the media changer commands must
be given in the server configuration with parameter
Changer-Configuration-File
This file must name the commands, that really perform the moves
of the cartridges in a changer. A maximum if nine entries can
be given to specify, how to move a cartridge from or to a slot,
a drive or a loadbay (3 x 3 = 9). These parameters all have
names of the form Move-<origin>-To-<target>-Command with origin
and target being one of slot, drive and loadport, e.g.
Move-Slot-To-Drive-Command:
In these commands the following replacements are made:
%d the streamer device i.e. drive
%D the media changer device
%n the origin (e.g. slot) number, if the command starts to
count with 1
%m the origin number, if counting starts with 0
%N the target number, if counting starts with 1
%M the target number, if counting starts with 0
Commands, that are not supported for whatever reason, should
be commented out in this configuration file.
Two commands can be configured, that print the numbers of free
slots/loadports to standard output. If there are loadbays, that
should be used, the command, that lists the free ones, must be
present. The command listing the free slots must always be
there. The parameter names for these commands are:
List-Empty-Slots-Command and List-Empty-Loadports-Command .
In these commands only the pattern %D is replaced like
explained above.
For the most common changer driving commands (mtx and stc),
appropriate files are included into the distribution. They can
be used without any modifcation, just comment out the commands,
your hardware does not support (e.g. moving from slot to slot).
The cartridge locations database is an ASCII file in the var-
directory of the server side called cartridge_locations .
Like all the files there it should not be modified manually.
$BASEDIR/server/bin/afserver [ <options> ] [ <configuration-file> ]
The server program. It must be started by the inetd-superdaemon.
The configuration-file is read as $BASEDIR/server/lib/backup.conf
if not given explicitly and if not found there the default files
/etc/buserver.conf, /etc/afbuserver.conf, /etc/afserver.conf and
/etc/afbackup/server.conf are tried.
Options:
-b Turns off buffering mode. This reduces performance
but seems to be necessary on some OSes
-L <locale> Set the locale to the given string. Note, that this
option might not be honoured due to insufficiencies
of the gettext implementation on some systems
-S Run in slave mode. This option should is used, when
the program is started as backend for the multi-
stream server and should not be configured for
normal startup
Options for debugging purposes only:
-D Enter an infinite loop at startup to be caught
using a debugger or continue, when a USR1 signal
is sent to the process
-s Don't use secure mode for client requests. No
authentication is performed
-l <file> Use a different logfile than set in the config
file (see: Parameter Logging-File)
-x <dir> Use a different directory for remotely startable
programs (see: Parameter Program-Directory)
$BASEDIR/server/bin/afmserver [ options ] [ <configuration-file> ]
The multi-stream server able to serve several clients in parallel.
This program works as a protocol multiplexing frontend for the
normal server, that in turn is started as backend in slave mode.
For the client side this server looks exactly like the normal
single stream server, so for them there is nothing special contac-
ting the multi stream server.
The clients must pass a unique identifier to the multi stream
server. Otherwise it cannot distinguish the clients, especially
when dispatching the data on tape to the clients. By default this
identifier is the official hostname of the client, that is
determined from the connection. A client may pass a different
identifier after having connected and authenticated successfully.
The options are identical to those of the server program except
for -S, that is not applicable here, cause the multi-stream
server doesn't know a slave mode. The other options are passed to
the server backend (see under afserver above), except for the
following, that are understood only by afmserver:
-d Daemonize. Go into the background and run forever.
This is the way, the multi stream server can be
started without using the inetd. -p should be
supplied when using this option
-p <port> The TCP port number or service name, the server
should bind to. If started via inetd, the inetd
binds to the port and starts the afmserver connected
to the port. When started as daemon, the afmserver
must be told the port to bind to. If not given,
the service entry afmbackup is used or, if not
found, the default port 2989
Programs of the client side
---------------------------
$BASEDIR/client/bin/full_backup
Run a full backup. The usage:
full_backup [ -daG ] [ {+-}LBx ] [ <files> <directories> ... ] \
[ -C <root-directory> ] [ -F \"<files-to-skip>\" ] \
[ -D \"<directories-to-skip>\" ] \
[ -c <configuration-file> ] [ -W <identity> ] \
[ -h <backuphosts> ] [ -P <backup-ports> ] \
[ -I <indexfile-part> ] \
[ { -N <num-indexes-to-store> ] | \
-O <max-age-of-indexes-to-store-in-days> } ] \
[ -z <process-cmd> <unprocess-cmd> ] \
[ -Z <built-in-compress-level> ] \
[ -s \"<dont-process-patterns>\" ] \
[ -X <exclude-list-file> ] [ -l <logfile> ] \
[ -i <startup-info-program> ] \
[ -b <init-program> ] [ -e <exit-program> ] \
[ -k <encryption-key-file> ] \
[ -f <filesystem-types> ] \
[ -V <var-directory> ] [ -S <cartridge-sets> ]
This program reads the client-side configuration file and runs
(eventually a part of) a full backup of all files and directories
specified in the configuration file or on the commandline. It is
recommended to setup everything in the configuration file and run
this command without any arguments (same applies for incr_backup).
If files and/or directories are supplied on the commandline, those
specified in the configuration file are overridden. Furthermore
the program then behaves slightly different: If backup parts are
configured, they are ignored. The timestamp, that is evaluated
during incremental backup to determine, whether files have been
modified, is not changed. This behaviour reflects the assumption,
that supplying files or directories on the commandline is done
for testing or other temporary purposes. Modifying the timestamp
would confuse the normal regularly running backup mechanism. In
these temporary cases the -a option should make sense, see below
for details. Be also aware of the -C option's meaning. If the name
of a file is preceded with -r, the contents of the file is stored,
but not the characteristics of the inode. This is useful for
saving raw devices. By default, processing is always turned off.
Using -R forces processing of the contents. Preceding a directory
name with -m the recursive descent into this directory is limited
to the filesystem, where the directory resides.
The names of the files and directories, that are stored, are
written into logfiles, that comprise of the indexfile-part (-I)
and the current total backup counter. This counter is incremented
each time a full backup (part 1) starts. A minimum information
required to restore after a hard crash having lost everything is
piped into the startup-info-program (-i).
Whether only a part of a full backup is run depends on the setting
of the parameter NumBackupParts (See: CONFIG). If the configuration
file is not supplied explicitly, then it is searched for in the
.../lib-directory and if not found there the files
/etc/buclient.conf, /etc/afbuclient.conf, /etc/afclient.conf and
/etc/afbackup/client.conf are tried.
Commandline options generally override configuration file settings.
Every option described below (except -c) has a corresponding
entry in the configuration file, but there are more possible
settings in the config file.
-a Append mode. Do not increment the total backup
counter. (See -N)
{+-}B Perform per-file processing on the stored files
(+B) or not (-B) (See: -F)
-b <initprog> Run the given program before attempting a backup.
If the command returns an exit status unequal
to 0, no backup is performed (see: -e). Not to
be mixed up with option -i
-C <rootdir> Change to the given directory before starting the
backup climbing down into the directories to be
stored
-c <configfile> A different configuration file to use
-D <skip-dirs> A list of directory name patterns separated by
whitespace to ignore for backup. Several must be
put into quotes (See: -F and -X)
-d Detach from the terminal when starting
-e <exitprog> Run the specified program after finishing. If the
command comprises of several words separated by
whitespace, it must be put into quotes (See: -i)
-F <skip-files> A list of filename patterns separated by whitespace
to ignore for backup. Several must be put into
quotes (See: -D and -X)
-f <fs-types> A list of filesystem types, separated by whitespace
and/or commas. The type names can be prefixed
with a plus, what is identical with no prefix,
with a dash - or a slash / . No prefix or a plus
means, that only files in filesystems of the
given type are saved, no others. A minus means,
files in a filesystem of the named type are not
saved, nonetheless such filesystems are traversed
to search for filesystems of other types probably
mounted underneath. The slash means, that such
filesystems are not even entered or traversed. If
the - or + prefix is used, no space is allowed
between option -f and it's argument, e.g. -f-nfs
-G To request a new cartridge. If the current writing
position is already at the beginning of a new or
reused tape, nothing happens
-h <backuphosts> The names of the hosts, where a backup server side
lives. The list can be separated by commas and/or
whitespace. If whitespace is present, quotes are
necessary. The hosts are tested for service
availability. If a backup server is not ready,
the next one is tried. If all are busy, the program
waits for a minute and tries again
-I <idx-prefix> The first part of the filename, the names of the
stored files and directories are written to. The
current total backup number is appended (that
increments each start of a full backup). If these
files undergo processing, .z is appended
-i <info-prog> The command to save startup information. A minimum
information to recover from a hard crash is piped
into this program (at stdin). If the command
comprises of several words, it must be put into
quotes. Not to be mixed up with option -b
-k <file> Use the contents of the given file as encryption
key for authenticating to the server
{+-}L Process the filename list files (+L) or not (-L)
(See: -I)
-l <logfile> Write loggings into the given logfile. A dash -
means: no logging, only write to stderr
-N <num-idxes> The number of filename list files, that is stored
over time. A new list is begun at each start of
a full backup (except -a is supplied)
-O <maxidxage> The maximum age of the filename list files (== index
files) in days, that is stored. See also option
-N . A floating point number is allowed here
-P <portnos> The port numbers, that are tried to connect at the
servers. They must be supplied positionally according
to the configured or (with the -h option) given
backup servers. The list may be separated by whitespace
and/or commas. If whitespace is present, quotes are
necessary
-S <cartsets> The cartridge sets to use, where <cartsets> is a
number of a valid cartridge set on the appropriate
server side. Default is 1. These must be supplied
positionally according to the configured or (with
the -h option) given backup servers. The list may
be separated by whitespace and/or commas. If
whitespace is present, quotes are necessary
-s <noproc> A list of filename patterns, that no processing is
attempted on, what can save time significantly.
The list should always be enclosed in quotes
-V <var-dir> The directory, where varying files are put
-v be verbose
-W <id> Identify as <id> to the server. This is needed when
connecting a multi-stream server to distinguish
between the clients. Default is the official
hostname of the client. If the client should fake
to be a different one than it is in fact, this
option must be used. This flag can also be useful
e.g. to explicitly store the serverside
var-directory, that is crucial for restore and
should be saved seperately after all other backup
clients are done
-X <excl-file> The name of a file, that may exist in any directory
containing a list of filename patterns, one per
line. All files and directories in that directory
matching one of the patterns are exluded from
backup (See: -D and -F)
{+-}x Write CRC32 checksums for each file to tape (+x) or
don't do this (-x). This option is ignored, if
built-in compression is selected, cause then CRC32
checksumming is already performed
-z <z> <uz> The commands to use for process and unprocess. If
a command comprises of several words, it must be
put in quotes
-Z <level> If built-in compression should be used, the level
can be supplied here. If commands to process and
unprocess are also supplied with option -z, then
data is first processed by the process command,
then by built-in compression. During uncompress
it works the other way round
A table of corresponding command line options and configuration
file entries, (subsets) accepted by full_backup, incr_backup,
restore, verify:
Option Client configuration file parameter name
+B -B ProcessBackupedFiles
-b InitProgram
-C RootDirectory
-D DirsToSkip
-E UseCTime
-e ExitProgram
-F FilesToSkip
-f FilesystemTypes
-h BackupHosts
-I IndexFilePart
-i StartupInfoProgram
-k EncryptionKeyFile
-l LoggingFile
+L -L ProcessLogfiles
-N NumIndexesToStore (*_backup), NumIndexesToScan (afrestore)
-O DaysToStoreIndexes (*_backup), DaysToScanIndexes (afrestore)
-P BackupPorts
-S CartridgeSets
-s DoNotProcess
-V VarDirectory
-W ClientIdentifier
-X ExcludeListFile
-x WriteChecksums
-z ProcessCmd UnprocessCmd
-Z BuiltinCompressLevel
$BASEDIR/client/bin/incr_backup
Run an incremental backup. Usage: See full_backup above.
Additional options:
[ -EH ] [ -Q <backup-level> ]
This program reads the client-side configuration file and runs
an incremental backup, i.e. all files and directories are saved,
whose modification time is later than the moment the previous
backup (full or incremental) has started. The options and their
meanings are exactly the same as for full_backup, except for the
-a option, see below. The total backup counter is not increased.
-a Differential mode. The timestamp storing the
time of the last backup is not modified
-E Use not only the modification time comparing
the timestamps to select filesystem entries
for backup, but also the inode change
time (ctime)
-H If this flag is set, all backups with a lower level
since the last full backup are removed from the
indexes and the respective tapes freed, if there
is no other backup data on them. In differential
mode (-a) a previous differential backup is also
removed and the tapes freed, if possible
-Q <level> The backup level. All files modified since the
most recent backup with a level equal or
higher are saved. The higher this number, the
more files are redundantly saved again.
<level> can be an arbitrary number from 0
up to 2147483646 (== MAXINT - 1). Default: 0.
A full backup has an implicit backup level of
2147483647 (== MAXINT)
$BASEDIR/client/bin/afrestore
The restore utility. The Usage:
afrestore [ -nlvmi ] [ -<past-backup-no> ] [ -C <root-directory> ] \
[ -h <backuphosts> ] [ -P <backup-ports> ] \
[ -c <configuration-file> ] [ -W <identity> ] \
[ -A "<after-date>" ] [ -B "<before-date>" ] \
[ -T <tapes> ] [ -I <indexfile-part> ] \
[ -V <var-directory> ] [ -k <encryption-key-file> ] \
[ -z <process-cmd> <unprocess-cmd> ] \
[ -Z <built-in-compress-level> ] [ -F <format> ] \
[ { -N <num-indexfiles> | -O <indexfile-age-days> } ] \
[ -p ] <path-pattern> [ [ -p ] <path-patterns> [ ... ] ]
afrestore -a [ -nlvm ] [ -<past-backup-no> ] [ -C <root-directory> ] \
[ -h <backuphosts> ] [ -P <backup-ports> ] \
[ -c <configuration-file> ] [ -W <identity> ] \
[ -I <indexfile-part> ] [ -V <var-directory> ] \
[ -k <encryption-key-file> ] \
[ -z <process-cmd> <unprocess-cmd> ] \
[ -Z <built-in-compress-level> ] [ -F <format> ]
afrestore -{ef} [ -evm ] [ -C <root-directory> ] [ -h <backuphosts> ] \
[ -P <backup-ports> ] [ -V <var-directory> ] \
[ -z <process-cmd> <unprocess-cmd> ] \
[ -Z <built-in-compress-level> ] \
[ -k <encryption-key-file> ] [ -W <identity> ] \
[ -c <configuration-file> ] < <startup-info-file>
afrestore -E [ -Enlvm ] [ -C <root-directory> ] [ -h <backuphosts> ] \
[ -P <backup-ports> ] [ -V <var-directory> ] \
[ -z <process-cmd> <unprocess-cmd> ] \
[ -Z <built-in-compress-level> ] \
[ -k <encryption-key-file> ] [ -W <identity> ] \
[ -c <configuration-file> ] \
[ <cartridge-number> | <cartridge-range> ] ... ]
The first form can be used for restoring selected pieces of
a certain previous backup run. If no option of the type
-<past-backup-no> is supplied (e.g. -2 ), the most recently
made backup is accessed. If an option like this is given,
the backup system tries to extract the files from the backup
before ( -1 ) or even an earlier one. This requires, that
enough file- and directory-name-logging is provided. This
can be done with the client-side configuration parameter
NumIndexesToStore (See: CONFIG). The parameters <path-pattern>
indicate, which files and directories should be restored. An
asterisk is implicitely put before and after the <path-pattern>,
so it is assumed to be a substring of the path. This can be
prevented preceding the <path-pattern> with the option -p.
These may be wildcards for the full path name leading to the
file relative to the directory, to that the client changes
before starting any backup or restore (See under the parameter
RootDirectory in CONFIG). Note, that you have to put these into
quotes, if you are using wildcards to prevent substutition. It
is a bad idea to restore a total backup entering: restore "*"
This leads to a huge filelist to be processed by the client,
what might plug up memory and/or temporary space in some
filesystem. Instead you should use the second form with the
option -a, what restores a total backup. The third form
restores without looking for filename log files. Instead it
reads the standard input for information, where to extract
from. The format expected at standard input is the same as
produced by incr_backup or full_backup, if the configuration
option StartupInfoProgram is used. The given program is then
supplied with the appropriate information and should write
it to some place outside the local host, so that it will not
be affected by a hard crash (see: StartupInfoProgram in
CONFIG). The flag -e can be supplied more than one time. In
that case the emergency restore goes back to the beginning of
the previous full backup, if the full backup is split into
several parts (configuration parameter NumBackupParts) and
the last part of the current full backup has not yes run. If
the backup parts configuration has changed after the beginning
of the previous full backup, this option should be considered,
as it gives additional safety, that really everything will be
restored. The fourth form scans the cartridges (if supplied)
on the given servers (if supplied, eventually with alternate
given port numbers - see below for the format, how to specify
cartridge/host/port-triples) for backups done from the host,
where the restore program is started and restores everything
it finds. The functionality is similar to -e, but no input has
to be supplied. Like with option -e, the -E flag can be given
several times, what has the same meaning like with option -e
(see above). If the client's hostname has changed or restore
should be done on another host, the original client ID must be
supplied with the -W option. Otherwise nothing or the wrong
stuff will be restored. Scanning the cartridges can take a lot
of time, but it should be several minutes, not hours.
Cartridges can be supplied in three forms as arguments: simple
numbers, ranges (e. g. as 3-5 without spaces), and ranges
relative to the current backup writing position (e. g. as -3).
In the latter case -0 means the cartridge, that will be written
to next time i.e. that holds the current writing point. -2 stands
for the latest 3 cartridges. To indicate, that a cartridge is
located at a certain backup server, maybe with a special port
number (if there are several backup servers), the cartridge
number or range can be followed by the at-character @, optionally
followed by the percent character % and the port number, e. g.
3-5@buhost%2989 . No whitespace is allowed in such a specifier.
If no port is given, the default port is assumed (2988). If no
hostname is given, the default backup server is used. Default
backup server is the first one in the list, that is configured
in the parameter file or overriden by the option -h. Any number
of ranges or numbers can be supplied, overlapping duplicates are
ignored. If no cartridge numbers are given, the program searches
backward from the current writing position on each configured
backup server until it thinks, it has enough backups found, or
all cartridges on that server have been tried. The found backups
are sorted in the correct order (using the stored backup time)
and afterwards everything found is restored. This form of the
command needs no information at all for an emergency restore. If
the configuration file is not supplied explicitly, then it is
searched for in the .../lib-directory and if not found there the
files /etc/buclient.conf, /etc/afbuclient.conf, /etc/afclient.conf
and /etc/afbackup/client.conf are tried.
Flags
-A <date> Restore files modified after the given date. The
date should be put into quotes, cause it usually
contains whitespace. Valid formats are e.g.:
MM/DD/YYYY hh:mm:ss
DD.MM.YYYY hh:mm:ss
or the formats produced by ctime(3) or date(1).
The year may be supplied in two digits or in the
non-US-formats be omitted, then the current year
is assumed. The seconds may also be omitted
(hh:mm), the whole time may be left off, then
00:00 is assumed. Thus the shortest valid format
is DD.MM
-B <date> Restore files modified before the given date. See
-A for the valid date formats
-C <root-dir> Change to the given root-directory before restoring
files instead of the one specified in the client
side configuration file. If this directory does
not exist, it will be created
-c <conffile> Use the given file for configuration information
-e Restore all files from the previous backup in an
emergency case without looking for the filename
logfiles, which are also restored
-F In combination with -l a format string for output.
Default is: only the full paths of the stored
files are printed, one per line. The format string
can also contain patterns representing other file
attributes present in the index file(s). Possible
patterns are:
%n The filename with full path like default
%b The basename of the file, without path
%O The username of the file owner
%o The user-ID of the file owner (integer)
%m The modification time in seconds since epoch
%M The modification time in readable format
%t The starting time of the backup containing
the file in seconds since epoch
%T Like %t, but in readable format
%h The hostname of the backup server, to that
the file has been backuped
%p The port number of the backup server, to that
the file has been backuped
%c The cartridge number on the server, the saved
file can be found on
%f The tape file number on cartridge %c, where
the saved file can be found
%% A percent character
Notes:
* The usual C-like backslash sequences are allowed,
but special characters within the filenames are
still printed as escape sequences, e.g. \n
* A newline at the end must be given explicitly as
backslash n (\n), otherwise no new line will start
* Double quotes should be written as \" within the
argument enclosed in single quotes
* To see several versions of a saved filesystem entry
in the indexes the option -B or -A must be given,
maybe with a condition, that is always true, e.g.
-B 23:59, what means: before today, 23:59
-f Restore only the filename logfiles in an emergency
case
-h <hostnames> Use the given list of hosts as backup servers. This
list is used only, if no hostname information can
be found as associated with the current filesystem
entry, that should be restored. The first host in
this list is the default server, if no hostname
information at all can be found. If -E is given
and no cartridge number is supplied at all, all
hosts in this list are tried one after the other.
The hostnames in this list can be separated by
whitespace and/or commas
-I <idx-prefix> The first part of the filename, the names of the
stored files and directories are written to. The
current total backup number is appended (that
increments each start of a full backup). If these
files undergo processing, .z is appended
-i Ignore case distinctions in the filename patterns
-k <file> Use the contents of the given file as encryption
key for authenticating to the server
-l Do not restore anything, just list the names of
the files and/or directories, that fit the supplied
path-part(s); in combination with -E: just scan the
given tape(s) and printout the minimum restore info,
that can be read by restore -e
-m Do not overwrite existing files (merge)
-N <numidxs> The maximum number of index files, that are scanned
for matching filenames. With each full backup, a new
index file is created. If time restrictions are given
(options -A or -B), all existing index files are
read, what may take a long time, if many of them are
kept available (see clientside configuration option
NumIndexesToStore or option -N of full_backup). So
using this parameter the scanning can be restricted
to a certain number of files
-O <maxidxag> The maximum age of index files, that are scanned for
matching filenames, in days. See option -N . The
given number of days may be a floating point value
-n Do not restore anything, just printout a message,
how many files and/or directories fit the supplied
path-part(s); in combination with -E: just scan the
given tape(s) and printout, what backups have been
written there
-P <portnos> The list of port numbers for the backup servers
either configured in the parameter file or supplied
with the -h option. This list is used only, if no
port number information can be found as associated
with the current filesystem entry, that should be
restored. The port numbers supplied here are asso-
ciated with the backup server names by position.
The port numbers in this list can be separated by
whitespace and/or commas
-T <tapes> Restore and list only files from the given list of
tapes. Tapes can be specified using numbers, commas
and dashes, e.g. 3-5,8,1
-V <var-dir> The directory, where varying files are put
-v be verbose
-W <id> Identify as <id> to the server. This is needed when
connecting a multi-stream server to distinguish
between the clients. Default is the official
hostname of the client. If the client should fake
to be a different one than it is in fact, this
option must be used
-z <z> <uz> The commands to use for process and unprocess. If
a command comprises of several words, it must be
put in quotes
-Z <level> If built-in compression should be used, the level
can be supplied here. If commands to process and
unprocess are also supplied with option -z, then
data is first processed by the process command,
then by built-in compression. During uncompress
it works the other way round
I suggest to run restore with the -l option before really going
to restore anything. So you see, what files will be generated,
maybe overwriting existing ones unintendedly (or use option -m).
$BASEDIR/client/bin/afverify
Run a verify of a previous backup. The usage:
afverify [ -lav ] [ -c <configuration-file> ] \
[ -<past-run-no>[.<past-backup-no>] ] \
[ -h <backuphosts> ] [ -P <backup-ports> ] \
[ -C <root-directory> ] [ -S <cartridge-sets> ] \
[ -I <indexfile-part> ] [ -V <var-directory> ] \
[ -k <encryption-key-file> ] [ -W <identity> ] \
[ -z <process-cmd> <unprocess-cmd> ] \
[ -Z <built-in-compress-level> ]
Without any arguments, this program runs a verify over the
previously written backup. This may either be a full or an
incremental backup, only the contents of the very previous
run are used. All found differences are reported.
Though it is not considered to make too much sense, it is
also provided, that files and directories saved during a run
before the previous one can be checked. This can be done
supplying the <past-backup-specifier>. If this is a simple
number, it counts back from the previous full or incremental
backup of the same total backup number (this number is increased
each run of the full_backup-command, not by subsequent
incremental backups). -1 means, that the backup before the
previous one is checked and so on. If the contents of a previous
total backup run should be checked, the following form may
be used: -<previous-run>.<previous-total-backup>, where
<previous-total-backup> counts back from the current total backup
number and <previous-run> counts back from the last backup
(incremental or full) run among the previous total. previous-run
may be 0 here. E.g. verify -0.1 checks the files saved during
the last run of the previous total backup. Run afverify with
option -l, optionally -a or -<prev-total-backup> to get a list
of backups available for verify.
-a Together with -l list the available backups from
all indexes and not only the most recent one
-C <root-dir> Change to the given root-directory before verifying
files instead of the one specified in the client
side configuration file.
-c <conffile> Use the given file for configuration information
-h <hostnames> Use the given list of hosts as backup servers. This
list is used only, if no hostname information can
be found as associated with the current filesystem
entry, that should be verified. The first host in
this list is the default server, if no hostname
information at all can be found. The hostnames in
this list can be separated by whitespace and/or
commas
-I <idx-prefix> The first part of the filename, the names of the
stored files and directories can be found. The
current total backup number is appended (that
increments each start of a full backup). If these
files undergo processing, .z is appended
-l Don't actually verify, but print summary information
about available backups, that can be verified or
restored from, prefixed with the arguments, that
may be supplied as -<past-run-no>[.<past-backup-no>]
-k <file> Use the contents of the given file as encryption
key for authenticating to the server
-P <portnos> The list of port numbers for the backup servers
either configured in the parameter file or supplied
with the -h option. This list is used only, if no
port number information can be found as associated
with the current filesystem entry, that should be
verified. The port numbers supplied here are asso-
ciated with the backup server names by position.
The port numbers in this list can be separated by
whitespace and/or commas
-V <var-dir> The directory, where varying files are put
-v Verbose mode: print information records on tape and
the names of the checked files during operation
-W <id> Identify as <id> to the server. This is needed when
connecting a multi-stream server to distinguish
between the clients. Default is the official
hostname of the client. If the client should fake
to be a different one than it is in fact, this
option must be used
-z <z> <uz> The commands to use for process and unprocess. If
a command comprises of several words, it must be
put in quotes
-Z <level> If built-in compression should be used, the level
can be supplied here. If commands to process and
unprocess are also supplied with option -z, then
data is first processed by the process command,
then by built-in compression. During uncompress
it works the other way round
In my opinion a verify makes only sense immediately following
an incremental or full backup with the purpose to check, whether
the files and directories did not get corrupt on the storage
media. If you want to do this (via cron or however), keep in
mind, that the verify takes at least the same time as the
backup itself. If you have a huge amount of data to save, the
additional verify might run you into time consumtion problems.
$BASEDIR/client/bin/copy_tape
Make a duplicate of a tape. The usage:
copy_tape [ -v ] [ -c <configuration-file> ] \
[ -l <logfile> ] [ -T <tmpdir> ] \
[ -h <source-server> ] [ -P <source-serverport> ] \
[ -C <source-cartridge> ] [ -F <tape-filenumber> ] \
[ -k <source-encryption-key-file> ] \
[ -D \
[ -h <target-server> ] [ -P <target-serverport> ] \
[ -C <target-cartridge> ] \
[ -k <target-encryption-key-file> ] ]
This command connects to one or two backup servers and makes
an identical copy of a tape to another one. The tape label
is rewritten, so that the destination tape keeps it's primary
cartridge number, but gets the number of the source tape as
secondary number. Thus it can be used instead of the tape
with that primary number. In fact both numbers are accepted
for backup, restore or other operations except the copy_tape
operation itself. Recursively copying an already duplicated
tape does not further change the secondary cartridge number,
so e.g. any copy of cartridge number 3 will be usable as such.
Copying cartridge 3 to cartridge 5 and then 5 to 8 does not
make cartridge number 8 usable as cartridge 5, but still as
cartridge number 3. When the backup server sees a cartridge
with the wrong primary number, but the correct secondary
number, this cartridge is accepted, but a warning is written
to the serverside log. The defaults for the copying source are
taken from the client side configuration file. Default source
cartridge is the one currently loaded in the drive on the
server, that will be asked for this information. If no target
parameters are supplied, they get the values of the appropriate
source parameters as default. So if no arguments are supplied,
the current tape would be copied to itself, what is prevented
while printing an error message. Target (or: destination)
parameters must always be following the -D option, source
parameters must be supplied in an earlier position. If the
source tape is operated by a different server than the target,
copying goes straight from one to the other. As two servers
(with a different port number) can reside on one host, this
process does not necessarily imply a network connection.
If source and target tape are handled by the same server, the
data to be copied must be stored somewhere inbetween. For this
purpose a temporary directory is created on the client, where
this program is started, usually in /tmp or /var/tmp (see:
tmpnam(3)). The filesystem, where this directory lives, must
have a free capacity of at least the largest occurring tape
file. This maximum tape file size is configured on the server
side by the parameter MaxBytesPerFile (see: afserver.conf(8)).
If there is not enough space, the duplication of the tape
fails. The copying program writes as many tape files to disk
as it can, while a certain amount will remain free. Then it
ejects the source cartridge and loads the target cartridge.
Now the files in the temporary directory are written to the
target tape while immediately removing files, that are no
longer needed. The more space is available in the temporary
directory, the fewer cartridge loads/ejects are necessary.
-C <cartridge> The number of the cartridge to use as copying
source or target (depends on argument position:
before or behind -D).
-c <configfile> Use the given file for configuration information
-F <tapefilenum> If reading and writing should not start at the
beginning of the tape, but at the tape file with
the given number. This can avoid the overhead of
copying entire tapes, when only some tape files
have been appended
-h <hostname> The name of the backup server host, where the
source or target cartridge is handled,
respectively
-k <file> Use the contents of the given file as encryption
key for authenticating to the server, where the
source or target cartridge is handled,
respectively
-l <logfile> A file to write log information to
-P <portnum> The port number of the backup server on the
backup server host, where the source or target
cartridge is handled
-v Verbose option, tell more about what is going on
$BASEDIR/client/bin/update_indexes
clean indexes from erased tapes
update_indexes [ -v ] [ -c <configuration-file> ]
[ -h <backuphosts> ] [ -P <backup-ports> ]
[ -I <indexfile-part> ] [ -V <var-directory> ]
[ -k <encryption-key-file> ] [ -W <identity> ]
[ -z <process-cmd> <unprocess-cmd> ]
[ -Z <built-in-compress-level> ]
This command asks all the servers, which tapes are considered
precious for the client, it is run on. If the server will tell
fewer tapes than the client has in mind, then the tapes, that
the server omitted, have been erased on the server side. Now
those entries will be removed from the client's indexes, who
list the erased tapes as backup location.
This command may be installed setuid root, so normal users can
start it. As it performs just a defined update operation and
nothing else, there should not be a security problem. It might
be a good idea to run this command before some user restore
program (e.g. xafrestore) is started, so only those entries
are listed to the user, that really exist on backup media and
can be restored. When started by a normal user, all arguments
will be ignored and only the configuration file is evaluated.
-c <configfile> Use the given file for configuration information
-h <hostnames> Use the given list of hosts as backup servers.
The hostnames in this list can be separated by
whitespace and/or commas
-I <idx-prefix> The first part of the filename, the names of the
stored files and directories can be found. The
current total backup number is appended (that
increments each start of a full backup). If these
files undergo processing, .z is appended
-k <file> Use the contents of the given file as encryption
key for authenticating to the server, where the
source or target cartridge is handled,
respectively
-P <portnos> The list of port numbers for the backup servers
either configured in the parameter file or supplied
with the -h option. The port numbers in this list
can be separated by whitespace and/or commas
-V <var-dir> The directory, where varying files are put
-v Verbose option, tell more about what is going on
-W <id> Identify as <id> to the server. This is needed
by the server to tell the client the correct
information about tapes, that are considered
crucial for this client for restore
-z <z> <uz> The commands to use for process and unprocess. If
a command comprises of several words, it must be
put in quotes
-Z <level> If built-in compression should be used, the level
can be supplied here. If commands to process and
unprocess are also supplied with option -z, then
data is first processed by the process command,
then by built-in compression. During uncompress
it works the other way round
$BASEDIR/client/bin/afclient
The main program of the client side. This program does not read
configuration files or filelists nor does it maintain any other
persistently stored information. It's just the workhorse providing
the functionality, that is required by the higher level programs.
Here's the usage, that can be printed out typing: client -usage
afclient -cxtd [ -[RraunOvgiIqQZwbjGK] ] \
[ -D <destination> ] \
[ -M <server-message> ] \
[ -h <backup-server> ] \
[ -z <zipcmd> <unzipcmd> ] \
[ -T <to-extract-file/tmpdir-for-copytape> ] \
[ -C <cartridge-number> ] \
[ -F <filenumber-on-tape> ] \
[ -f <archive-filename> ] \
[ -e <errorlog-filename> ] \
[ -p <server-port-number> ] \
[ -N <newer-than-filename> ] \
[ -o <user-ID> ] \
[ -k <encrption-key-file> ] \
[ -s <dont-process-filepattern> [ -s ... ] ] \
[ -H <header> ] \
[ -V <statistics-report-file> ] \
[ -A <after-time-seconds> ] \
[ -B <before-time-seconds> ] \
[ -W <identity> ] \
[ <files> <directories> ... ]
afclient -X <program> \
[ -h <backup-client> ]
afclient -\? (to get help)
The first form is similar to tar, except that it contacts a
backup server, if the -f option is not supplied.
The second form is used to start a program remotely on
another host. In most cases this will be one of:
client -X full_backup -h <some-host>
client -X incr_backup -h <some-host>
Normally this host is a backup client and a backup is started
this way. Only programs can be started, that reside in the
directory, that is configured in the backup server's configu-
ration file unter "Program-Directory".
The third form produces the following help text:
Description
===========
This program is used to maintain archives on a backup server
host or in a file. Archives can be created, extracted or their
contents be listed. Almost one of the following flags has to
be supplied:
-c to create an archive
-x to extract from an archive
-t to list the contents of an archive
-d to verify (compare) the contents of an archive
-C to set a certain cartridge on the backup server
(makes only sense extracting or listing with -x or
-t, the writing position can't be changed by clients)
-F to set a certain file on the backup server's tape
(same applies as for -C)
-q to printout the current cartridge and tape file number
on the backup server
-Q to printout the cartridge and tape file number for the
the next write access on the backup server
-X followed by the full path name of a program to be started on
the client. This can be used to trigger a backup remotely.
If the program needs arguments, the command together with
the arguments has to be enclosed by quotes
-I to printout an index of the backups written to the
current cartridge
-w to check the status of the streamer on the server side, e.g.
whether it is ready and waiting for requests to service,
see below for possible states
-G to request a new cartridge for the next writing operation.
If the current writing position is already at the beginning
of a new or reused tape, nothing happens
-D <destination> to make an exact copy of a tape to another one
(duplicate). See below how to specify the destination tape.
Duplication can be either from one cartridge to another on
the same server, or from one server to another one. When
copying to the same server chunks of data are stored in a
temporary directory on the client, where the command is
started, what should preferably be the source server
-M <message> send a message to the server. Messages will in the
most cases contain whitespace, so they should be enclosed
in quotes. Server messages should be sent to the single
stream server (port), the multi stream server might hang
receiving a message due to systematical reasons. Several
messages can be put into the string. They must be separated
by a real newline character or the usual C-like \n .
The following messages are currently supported:
PreciousTapes: <list-of-tapes>
The list of tapes is inserted into the table
with the tapes, that are crucial for clients
to restore all files, that are listed in all
existing index files. These tapes will not be
overwritten until explicitly permitted. This
message is generated automatically and should
not be used in other user contexts
ReuseTapes: <list-of-tapes>
The opposite of PreciousTapes. Sending this
message permits the server to overwrite the
listed tapes, though they are crucial for
some client
TapesReadOnly: <list-of-tapes>
The list of tapes is inserted into the file
listing the files, that should not be written
any more for whatever reason
TapesReadWrite: <list-of-tapes>
This reverts the status of tapes set read-only
to read-write, the opposite of TapesReadOnly
CartridgeReady
When an operator is requested to do something
the server is waiting for, this message can be
sent to trigger the server to proceed. This
message has the same effect as the cartready
command
DeleteClient: <client-identifier>
The tapes, that are marked as reserved for a
client to recover all the data in his indexes,
are freed. That is, the appropriate line is
removed from the server's precious_tapes file
-c, -x, -t and -X are mutual exclusive. The other options can
be supplied as needed. To set the cartridge and/or the tape file
on the backup server is only making sense when not creating
an archive. The serial order of writing to tape is handled by
the server machine independently of the client.
Filenames
The names of the files and directories, that have to be put
into or extracted from an archive are by default read from the
standard input. If you supply filenames in the command line or
enter the -a flag when extracting, standard input is not read.
The same is valid, if filenames are read from a file with the
-T option. When reading the names from a file or from standard
input, they must be given one per line. If a name contains
special characters (like newline or nonprintable ones), they
have to be specified using backslash-sequences like in C-code,
e.g. \n for newline.
In save mode (-c) filenames can be prefixed with character
sequences, that have special meanings (no space between prefix
and filename):
/../ The file is not saved with all attributes present in
the inode, but only the contents are saved. This might
be useful for saving raw-devices
//../ With /../ the configured processing is not applied to
the file contents for safety reasons. With this prefix
processing can be forced nonetheless
||| and a mandatory space character indicates, that the
following characters up to (but not including) another
triple bar ||| should be interpreted as a shell command,
that is started and whose standard output is written to
the backup. At restore time the command following the
second triple bar is started and the data stream read
at backup time is written to it's standard input. This
might be useful for saving e.g. databases. The second
command may be terminated by a triple sharp ###, that
starts an optional comment. Example:
||| pg_dumpall ||| psql db_tmpl ### Store Postgres DBs
More options in alphabetical order:
- in combination with -c: read standard input and
write it to tape, in combination with -x: read
tape and write it to standard output
-A <time> process files (save or extract) modified after
the given time in seconds since 1.1.1970 00:00
-a in combination with -x: extract all files and
directories in the archive
-B <time> process files (save or extract) modified before
the given time in seconds since 1.1.1970 00:00
-b don't enter buffering mode
-e <errlog> Use the file <errlog> to write error messages to
instead of the standard error output
-f <file> write to or read from a file instead of querying
the backup server
-g while extracting/reading: ignore leading garbage,
suppress error messages at the beginning. This
is useful when extracting from tape files, that
are not the first ones of a whole archive.
-H <header> put the supplied informational header to the begin
of the backup. If a - is supplied (no space may
follow -H i.e. -H-) the information is read from
the first line of stdin. Backslash sequences of
C-like style are replaced
-h <host> use the backup server with the name <host>
default host is the machine with the name
backuphost
-i while extracting: ignore the stored ownership and
do not restore it
-j when starting to write: request starting a new
tape file
-K when packing, do not keep the access time of the
file. By default after packing a filesystem entry
it's previous atime is restored
-k <file> use the contents of the given file as encryption
key for authenticating to the server
-l for each packed or unpacked filename, if sending
to or receiving from a backup server in verbose
mode in combination with -n:
printout server name and port number at the
beginning of the line, e.g.: orion%2988!
-N <file> while archiving: ignore files with a modification
time before the one of the given file, only save
newer files or such with the same age in seconds
-n for each packed or unpacked filename, if sending
to or receiving from a backup server in verbose
mode:
printout cartridge and tape file number at the
beginning of the line, e. g.: 7.15: <filename>
In combination with -X: precede each line of
output received from the remotely started program
with the identifier of the remote host and a
colon, e. g.: darkstar: Full backup finished.
-O for each packed file creating a backup in verbose
mode: printout the user-ID of the file owner at
the beginning of the line prefixed with a bar |
eventually behind cartridge and file number
-o <uid> archive or extract only files owned by the user
with the given user-ID (an integer)
-p <portno> use a different port number for communicating with
the backup server. Default is TCP-Port 2988
-R pack or extract directories recursively with all
of their contents
-r use filenames relative to the current directory,
whether they start with a slash or not. If -r
is given more then 1 time, also let symlinks
originally pointing to absolute paths now point
to paths relative to the directory, where the
symlink will be created
-S <cartset> The cartridge set to use, where <cartset> is the
number of a valid cartridge set on the server
side. Default is 1. This option makes sense only
when creating backups with -c
-s <filepat> do not attempt processing on files matching the
given filename pattern. This parameter may
appear several times
-T <file/dir> read the filenames to process from the <file>.
The filenames must be separated by whitespace.
If whitespace is part of a filename, it has to
be enclosed by double quotes. Double quotes or
backslashes within the filename have to be
preceded by a backslash. In combination with
-D: the tape files to be copied are temporarily
stored in the given directory instead of the
default directory /tmp
-u while extracting: remove existing files with the
same name as found in the archive. Otherwise
no existing files are overwritten
-U for each packed file creating a backup in verbose
mode: printout the modification time of the file
in seconds since 1970/1/1 0:00 at the beginning
of the line prefixed with a tilde ~ eventually
behind cartridge number, file number and owner
-V <file> write a report containing statistics at the end of
a backup to the <file>
-v verbose mode: print the filenames while creating
or extracting, be a little more verbose while
listing contents. If -v is the only given flag:
print out software name and version
-W <id> identify as <id> to the server. This is needed when
connecting a multi-stream server to distinguish
between the clients. Default is the string
"<client-program>"
-z <z> <uz> use <z> as the command, that is used to process
files, <uz> for the corresponding unprocess.
The command has to read from stdin and to write
to stdout. If arguments have to be supplied to
<z> and/or <uz>, don't forget to use quotes. If
built-in compression is desired, the command for
processing has to start with a dot (.), followed
by a space and a number ranging from 1 to 9, that
specifies the compression level. If an additional
external command should process the data, it may
follow, separated from the compression level by
whitespace. The order of processing is: First the
external program processes the data, then built-in
compression is applied. An empty string has to be
supplied for <uz> (or any other dummy is ok), if
only built-in compression is desired.
Examples for <z>:
gzip (run external command gzip),
"gzip -2" (the same with an argument),
". 8" (only built-in compression level 8),
". 3 __descrpt -k /my/key" (run command __descrpt
and apply built-in compression level 3)
-Z while printing out the contents: check those files
in the archive that are processed for integrity.
While creating an archive: write a CRC32 checksum
for each file, file contents or command output to
the backup stream
-? to printout this text
The -w option reports one or more of the following states,
separated by the plus character + :
READY the device is not in use by any program and the
server side is ready to service requests
BUSY the device is in use and currently operated by the
afbackup service
DEVINUSE the streamer device is in use by some program, that
is not part of the afbackup service
UNAVAIL the streamer device is not accessible or in some
other way occupied
UNLOADED the device is not busy, but there is no tape loaded
CHANGEABLE when reported together with UNLOADED, a tape can be
loaded quickly e.g. using the afclient command with
option -C <cartno>. It is not considered quickly,
if a human operator must put the cartridge into the
drive, so in this case only UNLOADED is reported.
When reported with READY, the tape can be changed
quickly (same understanding as before).
The destination tape for the duplicate operation (-D) can be given
in two ways: either with the options -h, -p, -C and -k following
the -D immediately without space and enclosed in quotes, so that
they appear as an own argument list in one real argument, e.g.:
-D' -C 5 -h targethost -p targetport'
(double quotes are of course also possible ...).
The second format is as follows:
[<targetcart>][@<targethost>][%targetport>][:<targetcryptkeyfile>]
At least one of the specifiers must be present. Examples:
5@otherhost 5%2990:/keyfile/for/target/server @otherhost%2970
If one of the specifiers is omitted, it is assumed identical with
the copy source specified in the normal options -h, -p, -C and -k.
Copying a tape to itself is prevented.
Helper programs
---------------
The names of all the following programs are starting with two
underscores __ to indicate, that they don't have a functionality,
which refers directly to any backup or restore operations. They
can be used to achieve additional functionality or for further
convenience. They are listed in alphabetical order regardless of
usefulness or importance.
__descrpt
Program to encrypt data using a DES-algorithm. Usage:
__descrpt { -e | [ -d ] } [ -w ] [ -k <cryptkeyfile> ]
This program en- or decrypts the standard input to standard output.
The used key is derived from the string supplied at compile time or
read from the given cryptkeyfile. If -d is not supplied, data will
be encrypted, otherwise decrypted. -e is optional i.e. the default.
By default 128 Bit DES encryption is active. With the flag -w this
is reduced to weaker 64 Bit DES encryption, what is much less secure
but notably faster. If -w is supplied when encrypting, it must also
be given for decrypt.
This program can only be built, if the Eric Young's DES library is
available. The command make __descrpt in the source distribution
directory will compile and link it.
__inc_link
Script to modify a symlink to point to the next file, counted
by the trailing number. Usage:
__inc_link [ -s ] <symlink> <increment>
It will be determined, to what the given symlink points. The
integer number at the end of this filesystem entry will be
increased by the given increment (may be negative). The symlink
will be removed and a new one created pointing to the resulting
filesystem entry. If no filesystem entry with the resulting name
exists, an error message is printed. If the new symlink cannot
be created or the old one cannot be removed, error messages are
printed. If everything works fine and the -s flag (silent) is
not supplied, the name of the filesystem entry, to that the new
symlink points, is printed. If any error occurs, the original
symlink remains unchanged. E.g. if ls -l reports (among others):
lrwxrwxrwx 1 af user 13 Oct 8 14:00 the_link -> file.number.4
and the command __inc_link the_link 2 is entered, the result
of a following ls -l will be:
lrwxrwxrwx 1 af user 13 Oct 8 14:00 the_link -> file.number.6
and some more (file.number.6 must exist)
__mt
Wrapper script for mt on systems, where the count 0 for subcommands
like fsf leads to an error. Same usage applies for both __mt and mt.
__packpats
Auxiliary script used by xafrestore. The functionality of this
program is not important to any user or administrator. It's main
intention is to speed up the index scanning, cause otherwise the
Tcl/Tk-Script must do the entire evaluation, what is a real CPU
hog.
__piper
Program to create command pipes without the overhead of shells.
Usage:
__piper [ command [ args ] [ '|' command [ args ] [ '|' ... ] ] ]
This program simply gets one or more commands separated by the pipe
symbol | as arguments. When called from a shell commandline or in
any situation, where the whole command is interpreted by a shell,
the bar | has to be escaped from interpretation, either by preceding
it with a backslash or putting it into single quotes.
The arguments are chained (separated by single spaces each) and
then separated at word boundaries. If an argument should contain
whitespace, it must be double-quoted. The whole command pipeline may
be put into one single argument, so in a shell the following is ok:
__piper 'echo "Hello lots of space" | sed "s/ts of/st in/g"'
Double quotes, the pipe symbol and the backslash itself may be
escaped by a preceding backslash \.
The advantage using this program instead of a shell with the -c
option should be a much faster startup of the whole pipeline. This is
useful in the process- and unprocess commands of the client side.
__z
Program, that performs the same (un)compression like the built-in
compression. The synopsis of this program is:
__z [ -{123456789|d} ]
__z [ -123456789 ] compresses standard input to standard out
using the given compression level
__z -d uncompresses standard in to standard out
__numset
This program deals with sets of numbers and can either remove
elements of one set in another set of merge two sets. Synopsis:
__numset <set-1-specifier> {+|-|in} <set-2-specifier>
__numset # <set-specifier>
If the second argument is a +, then the two sets are merged. If
the second argument is -, the elements in set2 are removed from
set1. If the second argument is the word "in", then it is tested,
whether elements of set 1 are also contained in set 2. The number
of common elements will be the result in that case. If the first
argument is the character # (must be escaped in shell scripts,
e.g. write '#'), the result is the number of elements in the set
given as second argument. Number set specifiers should not contain
whitespace and may consist of numbers, commas and dashes. Examples
for number set specifiers:
3-9 4,5,9 1-3,6,9-13
Examples how to use __numset and the results:
prompt# __numset 1-3,5-9,14 + 10-12
1-3,5-12,14
prompt# __numset 1-3,5-9,14 - 5-13
1-3,14
prompt# __numset 3 - ""
3
prompt# __numset "" - 4,6,8
prompt# __numset 3 - 3-5
prompt# __numset # 4-9
6
prompt# __numset 3-6,9-12 in 10-20
3
prompt#
Notes: Any argument or result might be an empty string (i.e. set)
The numbers in the sets need not to be sorted
|