/usr/share/doc/backuppc/BackupPC.html is in backuppc 3.3.1-4ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 | <?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>BackupPC</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:craig@craigs-macbook-pro.local" />
</head>
<body style="background-color: white">
<table border="0" width="100%" cellspacing="0" cellpadding="3">
<tr><td class="_podblock_" style="background-color: #cccccc" valign="middle">
<big><strong><span class="_podblock_"> BackupPC</span></strong></big>
</td></tr>
</table>
<ul id="index">
<li><a href="#BackupPC-Introduction">BackupPC Introduction</a>
<ul>
<li><a href="#Overview">Overview</a></li>
<li><a href="#Backup-basics">Backup basics</a></li>
<li><a href="#Resources">Resources</a></li>
<li><a href="#Road-map">Road map</a></li>
<li><a href="#You-can-help">You can help</a></li>
</ul>
</li>
<li><a href="#Installing-BackupPC">Installing BackupPC</a>
<ul>
<li><a href="#Requirements">Requirements</a></li>
<li><a href="#What-type-of-storage-space-do-I-need-">What type of storage space do I need?</a></li>
<li><a href="#How-much-disk-space-do-I-need-">How much disk space do I need?</a></li>
<li><a href="#Step-1:-Getting-BackupPC">Step 1: Getting BackupPC</a></li>
<li><a href="#Step-2:-Installing-the-distribution">Step 2: Installing the distribution</a></li>
<li><a href="#Step-3:-Setting-up-config.pl">Step 3: Setting up config.pl</a></li>
<li><a href="#Step-4:-Setting-up-the-hosts-file">Step 4: Setting up the hosts file</a></li>
<li><a href="#Step-5:-Client-Setup">Step 5: Client Setup</a></li>
<li><a href="#Step-6:-Running-BackupPC">Step 6: Running BackupPC</a></li>
<li><a href="#Step-7:-Talking-to-BackupPC">Step 7: Talking to BackupPC</a></li>
<li><a href="#Step-8:-Checking-email-delivery">Step 8: Checking email delivery</a></li>
<li><a href="#Step-9:-CGI-interface">Step 9: CGI interface</a></li>
<li><a href="#How-BackupPC-Finds-Hosts">How BackupPC Finds Hosts</a></li>
<li><a href="#Other-installation-topics">Other installation topics</a></li>
<li><a href="#Fixing-installation-problems">Fixing installation problems</a></li>
</ul>
</li>
<li><a href="#Restore-functions">Restore functions</a>
<ul>
<li><a href="#CGI-restore-options">CGI restore options</a></li>
<li><a href="#Command-line-restore-options">Command-line restore options</a></li>
</ul>
</li>
<li><a href="#Archive-functions">Archive functions</a>
<ul>
<li><a href="#Configuring-an-Archive-Host">Configuring an Archive Host</a></li>
<li><a href="#Starting-an-Archive">Starting an Archive</a></li>
<li><a href="#Starting-an-Archive-from-the-command-line">Starting an Archive from the command line</a></li>
</ul>
</li>
<li><a href="#Other-CGI-Functions">Other CGI Functions</a>
<ul>
<li><a href="#Configuration-and-Host-Editor">Configuration and Host Editor</a></li>
<li><a href="#RSS">RSS</a></li>
</ul>
</li>
<li><a href="#BackupPC-Design">BackupPC Design</a>
<ul>
<li><a href="#Some-design-issues">Some design issues</a></li>
<li><a href="#BackupPC-operation">BackupPC operation</a></li>
<li><a href="#Storage-layout">Storage layout</a></li>
<li><a href="#Compressed-file-format">Compressed file format</a></li>
<li><a href="#Rsync-checksum-caching">Rsync checksum caching</a></li>
<li><a href="#File-name-mangling">File name mangling</a></li>
<li><a href="#Special-files">Special files</a></li>
<li><a href="#Attribute-file-format">Attribute file format</a></li>
<li><a href="#Optimizations">Optimizations</a></li>
<li><a href="#Some-Limitations">Some Limitations</a></li>
<li><a href="#Security-issues">Security issues</a></li>
</ul>
</li>
<li><a href="#Configuration-File">Configuration File</a>
<ul>
<li><a href="#Modifying-the-main-configuration-file">Modifying the main configuration file</a></li>
</ul>
</li>
<li><a href="#Configuration-Parameters">Configuration Parameters</a>
<ul>
<li><a href="#General-server-configuration">General server configuration</a></li>
<li><a href="#What-to-backup-and-when-to-do-it">What to backup and when to do it</a></li>
<li><a href="#How-to-backup-a-client">How to backup a client</a></li>
<li><a href="#Samba-Configuration">Samba Configuration</a></li>
<li><a href="#Tar-Configuration">Tar Configuration</a></li>
<li><a href="#Rsync-Rsyncd-Configuration">Rsync/Rsyncd Configuration</a></li>
<li><a href="#FTP-Configuration">FTP Configuration</a></li>
<li><a href="#Archive-Configuration">Archive Configuration</a></li>
<li><a href="#Email-reminders-status-and-messages">Email reminders, status and messages</a></li>
<li><a href="#CGI-user-interface-configuration-settings">CGI user interface configuration settings</a></li>
</ul>
</li>
<li><a href="#Version-Numbers">Version Numbers</a></li>
<li><a href="#Author">Author</a></li>
<li><a href="#Copyright">Copyright</a></li>
<li><a href="#Credits">Credits</a></li>
<li><a href="#License">License</a></li>
</ul>
<hr />
<h1 id="BackupPC-Introduction">BackupPC Introduction</h1>
<p>This documentation describes BackupPC version 3.3.1, released on 11 Jan 2015.</p>
<h2 id="Overview">Overview</h2>
<p>BackupPC is a high-performance, enterprise-grade system for backing up Unix, Linux, WinXX, and MacOSX PCs, desktops and laptops to a server's disk. BackupPC is highly configurable and easy to install and maintain.</p>
<p>Given the ever decreasing cost of disks and raid systems, it is now practical and cost effective to backup a large number of machines onto a server's local disk or network storage. For some sites this might be the complete backup solution. For other sites additional permanent archives could be created by periodically backing up the server to tape.</p>
<p>Features include:</p>
<ul>
<li><p>A clever pooling scheme minimizes disk storage and disk I/O. Identical files across multiple backups of the same or different PC are stored only once (using hard links), resulting in substantial savings in disk storage and disk writes.</p>
</li>
<li><p>Optional compression provides additional reductions in storage (around 40%). The CPU impact of compression is low since only new files (those not already in the pool) need to be compressed.</p>
</li>
<li><p>A powerful http/cgi user interface allows administrators to view the current status, edit configuration, add/delete hosts, view log files, and allows users to initiate and cancel backups and browse and restore files from backups.</p>
</li>
<li><p>The http/cgi user interface has internationalization (i18n) support, currently providing English, French, German, Spanish, Italian, Dutch, Polish, Portuguese-Brazilian and Chinese</p>
</li>
<li><p>No client-side software is needed. On WinXX the standard smb protocol is used to extract backup data. On linux, unix or MacOSX clients, rsync, tar (over ssh/rsh/nfs) or ftp is used to extract backup data. Alternatively, rsync can also be used on WinXX (using cygwin), and Samba could be installed on the linux or unix client to provide smb shares).</p>
</li>
<li><p>Flexible restore options. Single files can be downloaded from any backup directly from the CGI interface. Zip or Tar archives for selected files or directories from any backup can also be downloaded from the CGI interface. Finally, direct restore to the client machine (using smb or tar) for selected files or directories is also supported from the CGI interface.</p>
</li>
<li><p>BackupPC supports mobile environments where laptops are only intermittently connected to the network and have dynamic IP addresses (DHCP). Configuration settings allow machines connected via slower WAN connections (eg: dial up, DSL, cable) to not be backed up, even if they use the same fixed or dynamic IP address as when they are connected directly to the LAN.</p>
</li>
<li><p>Flexible configuration parameters allow multiple backups to be performed in parallel, specification of which shares to backup, which directories to backup or not backup, various schedules for full and incremental backups, schedules for email reminders to users and so on. Configuration parameters can be set system-wide or also on a per-PC basis.</p>
</li>
<li><p>Users are sent periodic email reminders if their PC has not recently been backed up. Email content, timing and policies are configurable.</p>
</li>
<li><p>BackupPC is Open Source software hosted by SourceForge.</p>
</li>
</ul>
<h2 id="Backup-basics">Backup basics</h2>
<dl>
<dt id="Full-Backup">Full Backup</dt>
<dd>
<p>A full backup is a complete backup of a share. BackupPC can be configured to do a full backup at a regular interval (typically weekly). BackupPC can be configured to keep a certain number of full backups. Exponential expiry is also supported, allowing full backups with various vintages to be kept (for example, a settable number of most recent weekly fulls, plus a settable number of older fulls that are 2, 4, 8, or 16 weeks apart).</p>
</dd>
<dt id="Incremental-Backup">Incremental Backup</dt>
<dd>
<p>An incremental backup is a backup of files that have changed since the last successful full or incremental backup. Starting in BackupPC 3.0 multi-level incrementals are supported. A full backup has level 0. A new incremental of level N will backup all files that have changed since the most recent backup of a lower level. <a href="#_conf_incrlevels_">$Conf{IncrLevels}</a> is used to specify the level of each successive incremental. The default value is all level 1, which makes the behavior the same as earlier versions of BackupPC: each incremental will back up all the files that changed since the last full (level 0).</p>
<p>For SMB and tar, BackupPC uses the modification time (mtime) to determine which files have changed since the last lower-level backup. That means SMB and tar incrementals are not able to detect deleted files, renamed files or new files whose modification time is prior to the last lower-level backup.</p>
<p>Rsync is more clever: any files whose attributes have changed (ie: uid, gid, mtime, modes, size) since the last full are backed up. Deleted, new files and renamed files are detected by Rsync incrementals.</p>
<p>BackupPC can also be configured to keep a certain number of incremental backups, and to keep a smaller number of very old incremental backups. If multi-level incrementals are specified then it is likely that more incrementals will need to be kept since lower-level incrementals (and the full backup) are needed to reconstruct a higher-level incremental.</p>
<p>BackupPC "fills-in" incremental backups when browsing or restoring, based on the levels of each backup, giving every backup a "full" appearance. This makes browsing and restoring backups much easier: you can restore from any one backup independent of whether it was an incremental or full.</p>
</dd>
<dt id="Partial-Backup">Partial Backup</dt>
<dd>
<p>When a full backup fails or is canceled, and some files have already been backed up, BackupPC keeps a partial backup containing just the files that were backed up successfully. The partial backup is removed when the next successful backup completes, or if another full backup fails resulting in a newer partial backup. A failed full backup that has not backed up any files, or any failed incremental backup, is removed; no partial backup is saved in these cases.</p>
<p>The partial backup may be browsed or used to restore files just like a successful full or incremental backup.</p>
<p>With the rsync transfer method the partial backup is used to resume the next full backup, avoiding the need to retransfer the file data already in the partial backup.</p>
</dd>
<dt id="Identical-Files">Identical Files</dt>
<dd>
<p>BackupPC pools identical files using hardlinks. By "identical files" we mean files with identical contents, not necessary the same permissions, ownership or modification time. Two files might have different permissions, ownership, or modification time but will still be pooled whenever the contents are identical. This is possible since BackupPC stores the file meta-data (permissions, ownership, and modification time) separately from the file contents.</p>
</dd>
<dt id="Backup-Policy">Backup Policy</dt>
<dd>
<p>Based on your site's requirements you need to decide what your backup policy is. BackupPC is not designed to provide exact re-imaging of failed disks. See <a href="#Some-Limitations">"Some Limitations"</a> for more information. However, the addition of tar transport for linux/unix clients, plus full support for special file types and unix attributes in v1.4.0 likely means an exact image of a linux/unix file system can be made.</p>
<p>BackupPC saves backups onto disk. Because of pooling you can relatively economically keep several weeks of old backups.</p>
<p>At some sites the disk-based backup will be adequate, without a secondary tape backup. This system is robust to any single failure: if a client disk fails or loses files, the BackupPC server can be used to restore files. If the server disk fails, BackupPC can be restarted on a fresh file system, and create new backups from the clients. The chance of the server disk failing can be made very small by spending more money on increasingly better RAID systems. However, there is still the risk of catastrophic events like fires or earthquakes that can destroy both the BackupPC server and the clients it is backing up if they are physically nearby.</p>
<p>Some sites might choose to do periodic backups to tape or cd/dvd. This backup can be done perhaps weekly using the archive function of BackupPC.</p>
<p>Other users have reported success with removable disks to rotate the BackupPC data drives, or using rsync to mirror the BackupPC data pool offsite.</p>
</dd>
</dl>
<h2 id="Resources">Resources</h2>
<dl>
<dt id="BackupPC-home-page">BackupPC home page</dt>
<dd>
<p>The BackupPC Open Source project is hosted on SourceForge. The home page can be found at:</p>
<pre><code> http://backuppc.sourceforge.net</code></pre>
<p>This page has links to the current documentation, the SourceForge project page and general information.</p>
</dd>
<dt id="SourceForge-project">SourceForge project</dt>
<dd>
<p>The SourceForge project page is at:</p>
<pre><code> http://sourceforge.net/projects/backuppc</code></pre>
<p>This page has links to the current releases of BackupPC.</p>
</dd>
<dt id="BackupPC-Wiki">BackupPC Wiki</dt>
<dd>
<p>BackupPC has a Wiki at <a href="http://backuppc.wiki.sourceforge.net">http://backuppc.wiki.sourceforge.net</a>. Everyone is encouraged to contribute to the Wiki. Anyone with a SourceForge account can edit the Wiki.</p>
<p>The old FAQ is at <a href="http://backuppc.sourceforge.net/faq">http://backuppc.sourceforge.net/faq</a>, but is deprecated in favor of the Wiki.</p>
</dd>
<dt id="Mailing-lists">Mailing lists</dt>
<dd>
<p>Three BackupPC mailing lists exist for announcements (backuppc-announce), developers (backuppc-devel), and a general user list for support, asking questions or any other topic relevant to BackupPC (backuppc-users).</p>
<p>The lists are archived on SourceForge and Gmane. The SourceForge lists are not always up to date and the searching is limited, so Gmane is a good alternative. See:</p>
<pre><code> http://news.gmane.org/index.php?prefix=gmane.comp.sysutils.backup.backuppc
http://sourceforge.net/mailarchive/forum.php?forum=backuppc-users</code></pre>
<p>You can subscribe to these lists by visiting:</p>
<pre><code> http://lists.sourceforge.net/lists/listinfo/backuppc-announce
http://lists.sourceforge.net/lists/listinfo/backuppc-users
http://lists.sourceforge.net/lists/listinfo/backuppc-devel</code></pre>
<p>The backuppc-announce list is moderated and is used only for important announcements (eg: new versions). It is low traffic. You only need to subscribe to one of backuppc-announce and backuppc-users: backuppc-users also receives any messages on backuppc-announce.</p>
<p>The backuppc-devel list is only for developers who are working on BackupPC. Do not post questions or support requests there. But detailed technical discussions should happen on this list.</p>
<p>To post a message to the backuppc-users list, send an email to</p>
<pre><code> backuppc-users@lists.sourceforge.net</code></pre>
<p>Do not send subscription requests to this address!</p>
</dd>
<dt id="Other-Programs-of-Interest">Other Programs of Interest</dt>
<dd>
<p>If you want to mirror linux or unix files or directories to a remote server you should use rsync, <a href="http://rsync.samba.org">http://rsync.samba.org</a>. BackupPC uses rsync as a transport mechanism; if you are already an rsync user you can think of BackupPC as adding efficient storage (compression and pooling) and a convenient user interface to rsync.</p>
<p>Two popular open source packages that do tape backup are Amanda (<a href="http://www.amanda.org">http://www.amanda.org</a>) and Bacula (<a href="http://www.bacula.org">http://www.bacula.org</a>). These packages can be used as complete solutions, or also as back ends to BackupPC to backup the BackupPC server data to tape.</p>
<p>Various programs and scripts use rsync to provide hardlinked backups. See, for example, Mike Rubel's site (<a href="http://www.mikerubel.org/computers/rsync_snapshots">http://www.mikerubel.org/computers/rsync_snapshots</a>), JW Schultz's dirvish (<a href="http://www.dirvish.org/">http://www.dirvish.org/</a>), Ben Escoto's rdiff-backup (<a href="http://www.nongnu.org/rdiff-backup">http://www.nongnu.org/rdiff-backup</a>), and John Bowman's rlbackup (<a href="http://www.math.ualberta.ca/imaging/rlbackup">http://www.math.ualberta.ca/imaging/rlbackup</a>).</p>
<p>Unison is a utility that can do two-way, interactive, synchronization. See <a href="http://freshmeat.net/projects/unison">http://freshmeat.net/projects/unison</a>. An external wrapper around rsync that maintains transfer data to enable two-way synchronization is drsync; see <a href="http://freshmeat.net/projects/drsync">http://freshmeat.net/projects/drsync</a>.</p>
<p>BackupPC provides many additional features, such as compressed storage, hardlinking any matching files (rather than just files with the same name), and storing special files without root privileges. But these other programs provide simple, effective and fast solutions and are definitely worthy of consideration.</p>
</dd>
</dl>
<h2 id="Road-map">Road map</h2>
<p>The new features planned for future releases of BackupPC are on the Wiki at <a href="http://backuppc.wiki.sourceforge.net">http://backuppc.wiki.sourceforge.net</a>.</p>
<p>Comments and suggestions are welcome.</p>
<h2 id="You-can-help">You can help</h2>
<p>BackupPC is free. I work on BackupPC because I enjoy doing it and I like to contribute to the open source community.</p>
<p>BackupPC already has more than enough features for my own needs. The main compensation for continuing to work on BackupPC is knowing that more and more people find it useful. So feedback is certainly appreciated, both positive and negative.</p>
<p>Beyond being a satisfied user and telling other people about it, everyone is encouraged to add links to <a href="http://backuppc.sourceforge.net">http://backuppc.sourceforge.net</a> (I'll see them via Google) or otherwise publicize BackupPC. Unlike the commercial products in this space, I have a zero budget (in both time and money) for marketing, PR and advertising, so it's up to all of you! Feel free to vote for BackupPC at <a href="http://freshmeat.net/projects/backuppc">http://freshmeat.net/projects/backuppc</a>.</p>
<p>Also, everyone is encouraged to contribute patches, bug reports, feature and design suggestions, new code, Wiki additions (you can do those directly) and documentation corrections or improvements. Answering questions on the mailing list is a big help too.</p>
<hr />
<h1 id="Installing-BackupPC">Installing BackupPC</h1>
<h2 id="Requirements">Requirements</h2>
<p>BackupPC requires:</p>
<ul>
<li><p>A linux, solaris, or unix based server with a substantial amount of free disk space (see the next section for what that means). The CPU and disk performance on this server will determine how many simultaneous backups you can run. You should be able to run 4-8 simultaneous backups on a moderately configured server.</p>
<p>Several users have reported significantly better performance using reiserfs compared to ext3 for the BackupPC data file system. It is also recommended you consider either an LVM or RAID setup (either in HW or SW; eg: 3Ware RAID10 or RAID5) so that you can expand the file system as necessary.</p>
<p>When BackupPC starts with an empty pool, all the backup data will be written to the pool on disk. After more backups are done, a higher percentage of incoming files will already be in the pool. BackupPC is able to avoid writing to disk new files that are already in the pool. So over time disk writes will reduce significantly (by perhaps a factor of 20 or more), since eventually 95% or more of incoming backup files are typically in the pool. Disk reads from the pool are still needed to do file compares to verify files are an exact match. So, with a mature pool, if a relatively fast client generates data at say 1MB/sec, and you run 4 simultaneous backups, there will be an average server disk load of about 4MB/sec reads and 0.2MB/sec writes (assuming 95% of the incoming files are in the pool). These rates will be perhaps 40% lower if compression is on.</p>
</li>
<li><p>Perl version 5.8.0 or later. If you don't have perl, please see <a href="http://www.cpan.org">http://www.cpan.org</a>.</p>
</li>
<li><p>Perl modules Compress::Zlib, Archive::Zip and File::RsyncP. Try "perldoc Compress::Zlib" and "perldoc Archive::Zip" to see if you have these modules. If not, fetch them from <a href="http://www.cpan.org">http://www.cpan.org</a> and see the instructions below for how to build and install them.</p>
<p>The File::RsyncP module is available from <a href="http://perlrsync.sourceforge.net">http://perlrsync.sourceforge.net</a> or CPAN. You'll need to install the File::RsyncP module if you want to use Rsync as a transport method.</p>
</li>
<li><p>If you are using smb to backup WinXX machines you need smbclient and nmblookup from the samba package. You will also need nmblookup if you are backing up linux/unix DHCP machines. See <a href="http://www.samba.org">http://www.samba.org</a>. Samba versions 3.x are stable and now recommended instead of 2.x.</p>
<p>See <a href="http://www.samba.org">http://www.samba.org</a> for source and binaries. It's pretty easy to fetch and compile samba, and just grab smbclient and nmblookup, without doing the installation. Alternatively, <a href="http://www.samba.org">http://www.samba.org</a> has binary distributions for most platforms.</p>
</li>
<li><p>If you are using tar to backup linux/unix machines, those machines should have version 1.13.7 at a minimum, with version 1.13.20 or higher recommended. Use "tar --version" to check your version. Various GNU mirrors have the newest versions of tar; see <a href="http://www.gnu.org/software/tar/">http://www.gnu.org/software/tar/</a>.</p>
</li>
<li><p>If you are using rsync to backup linux/unix machines you should have version 2.6.3 or higher on each client machine. See <a href="http://rsync.samba.org">http://rsync.samba.org</a>. Use "rsync --version" to check your version.</p>
<p>For BackupPC to use Rsync you will also need to install the perl File::RsyncP module, which is available from <a href="http://perlrsync.sourceforge.net">http://perlrsync.sourceforge.net</a>. Version 0.68 or later is required.</p>
</li>
<li><p>The Apache web server, see <a href="http://www.apache.org">http://www.apache.org</a>, preferably built with mod_perl support.</p>
</li>
</ul>
<h2 id="What-type-of-storage-space-do-I-need-">What type of storage space do I need?</h2>
<p>BackupPC uses hardlinks to pool files common to different backups. Therefore BackupPC's data store (/var/lib/backuppc) must point to a single file system that supports hardlinks. You cannot split this file system with multiple mount points or using symbolic links to point a sub-directory to a different file system (it is ok to use a single symbolic link at the top-level directory (/var/lib/backuppc) to point the entire data store somewhere else). You can of course use any kind of RAID system or logical volume manager that combines the capacity of multiple disks into a single, larger, file system. Such approaches have the advantage that the file system can be expanded without having to copy it.</p>
<p>Any standard linux or unix file system supports hardlinks. NFS mounted file systems work too (provided the underlying file system supports hardlinks). But windows based FAT and NTFS file systems will not work.</p>
<p>Starting with BackupPC 3.1.0, run-time checks are done at startup and at the start of each backup to ensure that the file system can support hardlinks, since this is a common area of configuration problems.</p>
<h2 id="How-much-disk-space-do-I-need-">How much disk space do I need?</h2>
<p>Here's one real example for an environment that is backing up 65 laptops with compression off. Each full backup averages 3.2GB. Each incremental backup averages about 0.2GB. Storing one full backup and two incremental backups per laptop is around 240GB of raw data. But because of the pooling of identical files, only 87GB is used. This is without compression.</p>
<p>Another example, with compression on: backing up 95 laptops, where each backup averages 3.6GB and each incremental averages about 0.3GB. Keeping three weekly full backups, and six incrementals is around 1200GB of raw data. Because of pooling and compression, only 150GB is needed.</p>
<p>Here's a rule of thumb. Add up the disk usage of all the machines you want to backup (210GB in the first example above). This is a rough minimum space estimate that should allow a couple of full backups and at least half a dozen incremental backups per machine. If compression is on you can reduce the storage requirements by maybe 30-40%. Add some margin in case you add more machines or decide to keep more old backups.</p>
<p>Your actual mileage will depend upon the types of clients, operating systems and applications you have. The more uniform the clients and applications the bigger the benefit from pooling common files.</p>
<p>For example, the Eudora email tool stores each mail folder in a separate file, and attachments are extracted as separate files. So in the sadly common case of a large attachment emailed to many recipients, Eudora will extract the attachment into a new file. When these machines are backed up, only one copy of the file will be stored on the server, even though the file appears in many different full or incremental backups. In this sense Eudora is a "friendly" application from the point of view of backup storage requirements.</p>
<p>An example at the other end of the spectrum is Outlook. Everything (email bodies, attachments, calendar, contact lists) is stored in a single file, which often becomes huge. Any change to this file requires a separate copy of the file to be saved during backup. Outlook is even more troublesome, since it keeps this file locked all the time, so it cannot be read by smbclient whenever Outlook is running. See the <a href="#Some-Limitations">"Some Limitations"</a> section for more discussion of this problem.</p>
<p>In addition to total disk space, you should make sure you have plenty of inodes on your BackupPC data partition. Some users have reported running out of inodes on their BackupPC data partition. So even if you have plenty of disk space, BackupPC will report failures when the inodes are exhausted. This is a particular problem with ext2/ext3 file systems that have a fixed number of inodes when the file system is built. Use "df -i" to see your inode usage.</p>
<h2 id="Step-1:-Getting-BackupPC">Step 1: Getting BackupPC</h2>
<p>Some linux distributions now include BackupPC. The Debian distribution, supported by Ludovic Drolez, can be found at <a href="http://packages.debian.org/backuppc">http://packages.debian.org/backuppc</a> and is included in the current stable Debian release. On Debian, BackupPC can be installed with the command:</p>
<pre><code> apt-get install backuppc</code></pre>
<p>In the future there might be packages for Gentoo and other linux flavors. If the packaged version is older than the released version then you may want to install the latest version as described below.</p>
<p>Otherwise, manually fetching and installing BackupPC is easy. Start by downloading the latest version from <a href="http://backuppc.sourceforge.net">http://backuppc.sourceforge.net</a>. Hit the "Code" button, then select the "backuppc" or "backuppc-beta" package and download the latest version.</p>
<h2 id="Step-2:-Installing-the-distribution">Step 2: Installing the distribution</h2>
<p>Note: most information in this step is only relevant if you build and install BackupPC yourself. If you use a package provided by a distribution, the package management system should take of installing any needed dependencies.</p>
<p>First off, there are five perl modules you should install. These are all optional, but highly recommended:</p>
<dl>
<dt id="Compress::Zlib">Compress::Zlib</dt>
<dd>
<p>To enable compression, you will need to install Compress::Zlib from <a href="http://www.cpan.org">http://www.cpan.org</a>. You can run "perldoc Compress::Zlib" to see if this module is installed.</p>
</dd>
<dt id="Archive::Zip">Archive::Zip</dt>
<dd>
<p>To support restore via Zip archives you will need to install Archive::Zip, also from <a href="http://www.cpan.org">http://www.cpan.org</a>. You can run "perldoc Archive::Zip" to see if this module is installed.</p>
</dd>
<dt id="XML::RSS">XML::RSS</dt>
<dd>
<p>To support the RSS feature you will need to install XML::RSS, also from <a href="http://www.cpan.org">http://www.cpan.org</a>. There is not need to install this module if you don't plan on using RSS. You can run "perldoc XML::RSS" to see if this module is installed.</p>
</dd>
<dt id="File::RsyncP">File::RsyncP</dt>
<dd>
<p>To use rsync and rsyncd with BackupPC you will need to install File::RsyncP. You can run "perldoc File::RsyncP" to see if this module is installed. File::RsyncP is available from <a href="http://perlrsync.sourceforge.net">http://perlrsync.sourceforge.net</a>. Version 0.68 or later is required.</p>
</dd>
<dt id="File::Listing-Net::FTP-Net::FTP::RetrHandle-Net::FTP::AutoReconnect">File::Listing, Net::FTP, Net::FTP::RetrHandle, Net::FTP::AutoReconnect</dt>
<dd>
<p>To use ftp with BackupPC you will need four libraries, but actually need to install only File::Listing from <a href="http://www.cpan.org">http://www.cpan.org</a>. You can run "perldoc File::Listing" to see if this module is installed. Net::FTP is a standard module. Net::FTP::RetrHandle and Net::FTP::AutoReconnect included in BackupPC distribution.</p>
</dd>
</dl>
<p>To build and install these packages you should use the cpan program. Alternatively, you can fetch the tar.gz file from <a href="http://www.cpan.org">http://www.cpan.org</a> and then run these commands:</p>
<pre><code> tar zxvf Archive-Zip-1.26.tar.gz
cd Archive-Zip-1.26
perl Makefile.PL
make
make test
make install</code></pre>
<p>The same sequence of commands can be used for each module.</p>
<p>Now let's move onto BackupPC itself. After fetching BackupPC-3.3.1.tar.gz, run these commands as root:</p>
<pre><code> tar zxf BackupPC-3.3.1.tar.gz
cd BackupPC-3.3.1
perl configure.pl</code></pre>
<p>In the future this release might also have patches available on the SourceForge site. These patch files are text files, with a name of the form</p>
<pre><code> BackupPC-3.3.1plN.diff</code></pre>
<p>where N is the patch level, eg: pl2 is patch-level 2. These patch files are cumulative: you only need apply the last patch file, not all the earlier patch files. If a patch file is available, eg: BackupPC-3.3.1pl2.diff, you should apply the patch after extracting the tar file:</p>
<pre><code> # fetch BackupPC-3.3.1.tar.gz
# fetch BackupPC-3.3.1pl2.diff
tar zxf BackupPC-3.3.1.tar.gz
cd BackupPC-3.3.1
patch -p0 < ../BackupPC-3.3.1pl2.diff
perl configure.pl</code></pre>
<p>A patch file includes comments that describe that bug fixes and changes. Feel free to review it before you apply the patch.</p>
<p>The configure.pl script also accepts command-line options if you wish to run it in a non-interactive manner. It has self-contained documentation for all the command-line options, which you can read with perldoc:</p>
<pre><code> perldoc configure.pl</code></pre>
<p>Starting with BackupPC 3.0.0, the configure.pl script by default complies with the file system hierarchy (FHS) conventions. The major difference compared to earlier versions is that by default configuration files will be stored in /etc/BackupPC rather than below the data directory, /var/lib/backuppc/conf, and the log files will be stored in /var/log/BackupPC rather than below the data directory, /var/lib/backuppc/log.</p>
<p>Note that distributions may choose to use different locations for BackupPC files than these defaults.</p>
<p>If you are upgrading from an earlier version the configure.pl script will keep the configuration files and log files in their original location.</p>
<p>When you run configure.pl you will be prompted for the full paths of various executables, and you will be prompted for the following information.</p>
<dl>
<dt id="BackupPC-User">BackupPC User</dt>
<dd>
<p>It is best if BackupPC runs as a special user, eg backuppc, that has limited privileges. It is preferred that backuppc belongs to a system administrator group so that sys admin members can browse BackupPC files, edit the configuration files and so on. Although configurable, the default settings leave group read permission on pool files, so make sure the BackupPC user's group is chosen restrictively.</p>
<p>On this installation, this is backuppc.</p>
<p>For security purposes you might choose to configure the BackupPC user with the shell set to /bin/false. Since you might need to run some BackupPC programs as the BackupPC user for testing purposes, you can use the -s option to su to explicitly run a shell, eg:</p>
<pre><code> su -s /bin/bash backuppc</code></pre>
<p>Depending upon your configuration you might also need the -l option.</p>
</dd>
<dt id="Data-Directory">Data Directory</dt>
<dd>
<p>You need to decide where to put the data directory, below which all the BackupPC data is stored. This needs to be a big file system.</p>
<p>On this installation, this is /var/lib/backuppc.</p>
</dd>
<dt id="Install-Directory">Install Directory</dt>
<dd>
<p>You should decide where the BackupPC scripts, libraries and documentation should be installed, eg: /usr/local/BackupPC.</p>
<p>On this installation, this is /usr/share/backuppc.</p>
</dd>
<dt id="CGI-bin-Directory">CGI bin Directory</dt>
<dd>
<p>You should decide where the BackupPC CGI script resides. This will usually be below Apache's cgi-bin directory.</p>
<p>It is also possible to use a different directory and use Apache's ``<Directory>'' directive to specifiy that location. See the Apache HTTP Server documentation for additional information.</p>
<p>On this installation, this is /usr/share/backuppc/cgi-bin.</p>
</dd>
<dt id="Apache-image-Directory">Apache image Directory</dt>
<dd>
<p>A directory where BackupPC's images are stored so that Apache can serve them. You should ensure this directory is readable by Apache and create a symlink to this directory from the BackupPC CGI bin Directory.</p>
</dd>
<dt id="Config-and-Log-Directories">Config and Log Directories</dt>
<dd>
<p>In this installation the configuration and log directories are located in the following locations:</p>
<pre><code> /etc/backuppc/config.pl main config file
/etc/backuppc/hosts hosts file
/etc/backuppc/pc/HOST.pl per-pc config file
/var/lib/backuppc/log/BackupPC log files, pid, status</code></pre>
<p>The configure.pl script doesn't prompt for these locations but they can be set for new installations using command-line options.</p>
</dd>
</dl>
<h2 id="Step-3:-Setting-up-config.pl">Step 3: Setting up config.pl</h2>
<p>After running configure.pl, browse through the config file, /etc/backuppc/config.pl, and make sure all the default settings are correct. In particular, you will need to decide whether to use smb, tar,or rsync or ftp transport (or whether to set it on a per-PC basis) and set the relevant parameters for that transport method. See the section <a href="#Step-5:-Client-Setup">"Step 5: Client Setup"</a> for more details.</p>
<h2 id="Step-4:-Setting-up-the-hosts-file">Step 4: Setting up the hosts file</h2>
<p>The file /etc/backuppc/hosts contains the list of clients to backup. BackupPC reads this file in three cases:</p>
<ul>
<li><p>Upon startup.</p>
</li>
<li><p>When BackupPC is sent a HUP (-1) signal. Assuming you installed the init.d script, you can also do this with "/etc/init.d/backuppc reload".</p>
</li>
<li><p>When the modification time of the hosts file changes. BackupPC checks the modification time once during each regular wakeup.</p>
</li>
</ul>
<p>Whenever you change the hosts file (to add or remove a host) you can either do a kill -HUP BackupPC_pid or simply wait until the next regular wakeup period.</p>
<p>Each line in the hosts file contains three fields, separated by white space:</p>
<dl>
<dt id="Host-name">Host name</dt>
<dd>
<p>This is typically the host name or NetBios name of the client machine and should be in lower case. The host name can contain spaces (escape with a backslash), but it is not recommended.</p>
<p>Please read the section <a href="#How-BackupPC-Finds-Hosts">"How BackupPC Finds Hosts"</a>.</p>
<p>In certain cases you might want several distinct clients to refer to the same physical machine. For example, you might have a database you want to backup, and you want to bracket the backup of the database with shutdown/restart using <a href="#_conf_dumppreusercmd_">$Conf{DumpPreUserCmd}</a> and <a href="#_conf_dumppostusercmd_">$Conf{DumpPostUserCmd}</a>. But you also want to backup the rest of the machine while the database is still running. In the case you can specify two different clients in the host file, using any mnemonic name (eg: myhost_mysql and myhost), and use <a href="#_conf_clientnamealias_">$Conf{ClientNameAlias}</a> in myhost_mysql's config.pl to specify the real host name of the machine.</p>
</dd>
<dt id="DHCP-flag">DHCP flag</dt>
<dd>
<p>Starting with v2.0.0 the way hosts are discovered has changed and now in most cases you should specify 0 for the DHCP flag, even if the host has a dynamically assigned IP address. Please read the section <a href="#How-BackupPC-Finds-Hosts">"How BackupPC Finds Hosts"</a> to understand whether you need to set the DHCP flag.</p>
<p>You only need to set DHCP to 1 if your client machine doesn't respond to the NetBios multicast request:</p>
<pre><code> nmblookup myHost</code></pre>
<p>but does respond to a request directed to its IP address:</p>
<pre><code> nmblookup -A W.X.Y.Z</code></pre>
<p>If you do set DHCP to 1 on any client you will need to specify the range of DHCP addresses to search is specified in <a href="#_conf_dhcpaddressranges_">$Conf{DHCPAddressRanges}</a>.</p>
<p>Note also that the <a href="#_conf_clientnamealias_">$Conf{ClientNameAlias}</a> feature does not work for clients with DHCP set to 1.</p>
</dd>
<dt id="User-name">User name</dt>
<dd>
<p>This should be the unix login/email name of the user who "owns" or uses this machine. This is the user who will be sent email about this machine, and this user will have permission to stop/start/browse/restore backups for this host. Leave this blank if no specific person should receive email or be allowed to stop/start/browse/restore backups for this host. Administrators will still have full permissions.</p>
</dd>
<dt id="More-users">More users</dt>
<dd>
<p>Additional user names, separate by commas and with no white space, can be specified. These users will also have full permission in the CGI interface to stop/start/browse/restore backups for this host. These users will not be sent email about this host.</p>
</dd>
</dl>
<p>The first non-comment line of the hosts file is special: it contains the names of the columns and should not be edited.</p>
<p>Here's a simple example of a hosts file:</p>
<pre><code> host dhcp user moreUsers
farside 0 craig jim,dave
larson 1 gary andy</code></pre>
<h2 id="Step-5:-Client-Setup">Step 5: Client Setup</h2>
<p>Four methods for getting backup data from a client are supported: smb, tar, rsync and ftp. Smb or rsync are the preferred methods for WinXX clients and rsync or tar are the preferred methods for linux/unix/MacOSX clients.</p>
<p>The transfer method is set using the <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> configuration setting. If you have a mixed environment (ie: you will use smb for some clients and tar for others), you will need to pick the most common choice for <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> for the main config.pl file, and then override it in the per-PC config file for those hosts that will use the other method. (Or you could run two completely separate instances of BackupPC, with different data directories, one for WinXX and the other for linux/unix, but then common files between the different machine types will duplicated.)</p>
<p>Here are some brief client setup notes:</p>
<dl>
<dt id="WinXX">WinXX</dt>
<dd>
<p>One setup for WinXX clients is to set <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> to "smb". Actually, rsyncd is the better method for WinXX if you are prepared to run rsync/cygwin on your WinXX client.</p>
<p>If you want to use rsyncd for WinXX clients you can find a pre-packaged zip file on <a href="http://backuppc.sourceforge.net">http://backuppc.sourceforge.net</a>. The package is called cygwin-rsync. It contains rsync.exe, template setup files and the minimal set of cygwin libraries for everything to run. The README file contains instructions for running rsync as a service, so it starts automatically everytime you boot your machine. If you use rsync to backup WinXX machines, be sure to set <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a> correctly (eg: 'cp1252') so that the WinXX file name encoding is correctly converted to utf8.</p>
<p>Otherwise, to use SMB, you can either create shares for the data you want to backup or your can use the existing C$ share. To create a new share, open "My Computer", right click on the drive (eg: C), and select "Sharing..." (or select "Properties" and select the "Sharing" tab). In this dialog box you can enable sharing, select the share name and permissions.</p>
<p>All Windows NT based OS (NT, 2000, XP Pro), are configured by default to share the entire C drive as C$. This is a special share used for various administration functions, one of which is to grant access to backup operators. All you need to do is create a new domain user, specifically for backup. Then add the new backup user to the built in "Backup Operators" group. You now have backup capability for any directory on any computer in the domain in one easy step. This avoids using administrator accounts and only grants permission to do exactly what you want for the given user, i.e.: backup. Also, for additional security, you may wish to deny the ability for this user to logon to computers in the default domain policy.</p>
<p>If this machine uses DHCP you will also need to make sure the NetBios name is set. Go to Control Panel|System|Network Identification (on Win2K) or Control Panel|System|Computer Name (on WinXP). Also, you should go to Control Panel|Network Connections|Local Area Connection|Properties|Internet Protocol (TCP/IP)|Properties|Advanced|WINS and verify that NetBios is not disabled.</p>
<p>The relevant configuration settings are <a href="#_conf_smbsharename_">$Conf{SmbShareName}</a>, <a href="#_conf_smbshareusername_">$Conf{SmbShareUserName}</a>, <a href="#_conf_smbsharepasswd_">$Conf{SmbSharePasswd}</a>, <a href="#_conf_smbclientpath_">$Conf{SmbClientPath}</a>, <a href="#_conf_smbclientfullcmd_">$Conf{SmbClientFullCmd}</a>, <a href="#_conf_smbclientincrcmd_">$Conf{SmbClientIncrCmd}</a> and <a href="#_conf_smbclientrestorecmd_">$Conf{SmbClientRestoreCmd}</a>.</p>
<p>BackupPC needs to know the smb share user name and password for a client machine that uses smb. The user name is specified in <a href="#_conf_smbshareusername_">$Conf{SmbShareUserName}</a>. There are four ways to tell BackupPC the smb share password:</p>
<ul>
<li><p>As an environment variable BPC_SMB_PASSWD set before BackupPC starts. If you start BackupPC manually the BPC_SMB_PASSWD variable must be set manually first. For backward compatibility for v1.5.0 and prior, the environment variable PASSWD can be used if BPC_SMB_PASSWD is not set. Warning: on some systems it is possible to see environment variables of running processes.</p>
</li>
<li><p>Alternatively the BPC_SMB_PASSWD setting can be included in /etc/init.d/backuppc, in which case you must make sure this file is not world (other) readable.</p>
</li>
<li><p>As a configuration variable <a href="#_conf_smbsharepasswd_">$Conf{SmbSharePasswd}</a> in /etc/backuppc/config.pl. If you put the password here you must make sure this file is not world (other) readable.</p>
</li>
<li><p>As a configuration variable <a href="#_conf_smbsharepasswd_">$Conf{SmbSharePasswd}</a> in the per-PC configuration file (/etc/backuppc/pc/$host.pl or /var/lib/backuppc/pc/$host/config.pl in non-FHS versions of BackupPC). You will have to use this option if the smb share password is different for each host. If you put the password here you must make sure this file is not world (other) readable.</p>
</li>
</ul>
<p>Placement and protection of the smb share password is a possible security risk, so please double-check the file and directory permissions. In a future version there might be support for encryption of this password, but a private key will still have to be stored in a protected place. Suggestions are welcome.</p>
<p>As an alternative to setting <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> to "smb" (using smbclient) for WinXX clients, you can use an smb network filesystem (eg: ksmbfs or similar) on your linux/unix server to mount the share, and then set <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> to "tar" (use tar on the network mounted file system).</p>
<p>Also, to make sure that file names with special characters are correctly transferred by smbclient you should make sure that the smb.conf file has (for samba 3.x):</p>
<pre><code> [global]
unix charset = UTF8</code></pre>
<p>UTF8 is the default setting, so if the parameter is missing then it is ok. With this setting <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a> should be emtpy, since smbclient has already converted the file names to utf8.</p>
</dd>
<dt id="Linux-Unix">Linux/Unix</dt>
<dd>
<p>The preferred setup for linux/unix clients is to set <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> to "rsync", "rsyncd" or "tar".</p>
<p>You can use either rsync, smb, or tar for linux/unix machines. Smb requires that the Samba server (smbd) be run to provide the shares. Since the smb protocol can't represent special files like symbolic links and fifos, tar and rsync are the better transport methods for linux/unix machines. (In fact, by default samba makes symbolic links look like the file or directory that they point to, so you could get an infinite loop if a symbolic link points to the current or parent directory. If you really need to use Samba shares for linux/unix backups you should turn off the "follow symlinks" samba config setting. See the smb.conf manual page.)</p>
<p>The requirements for each Xfer Method are:</p>
<dl>
<dt id="tar">tar</dt>
<dd>
<p>You must have GNU tar on the client machine. Use "tar --version" or "gtar --version" to verify. The version should be at least 1.13.7, and 1.13.20 or greater is recommended. Tar is run on the client machine via rsh or ssh.</p>
<p>The relevant configuration settings are <a href="#_conf_tarclientpath_">$Conf{TarClientPath}</a>, <a href="#_conf_tarsharename_">$Conf{TarShareName}</a>, <a href="#_conf_tarclientcmd_">$Conf{TarClientCmd}</a>, <a href="#_conf_tarfullargs_">$Conf{TarFullArgs}</a>, <a href="#_conf_tarincrargs_">$Conf{TarIncrArgs}</a>, and <a href="#_conf_tarclientrestorecmd_">$Conf{TarClientRestoreCmd}</a>.</p>
</dd>
<dt id="rsync">rsync</dt>
<dd>
<p>You should have at least rsync 2.6.3, and the latest version is recommended. Rsync is run on the remote client via rsh or ssh.</p>
<p>The relevant configuration settings are <a href="#_conf_rsyncclientpath_">$Conf{RsyncClientPath}</a>, <a href="#_conf_rsyncclientcmd_">$Conf{RsyncClientCmd}</a>, <a href="#_conf_rsyncclientrestorecmd_">$Conf{RsyncClientRestoreCmd}</a>, <a href="#_conf_rsyncsharename_">$Conf{RsyncShareName}</a>, <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a>, and <a href="#_conf_rsyncrestoreargs_">$Conf{RsyncRestoreArgs}</a>.</p>
</dd>
<dt id="rsyncd">rsyncd</dt>
<dd>
<p>You should have at least rsync 2.6.3, and the latest version is recommended. In this case the rsync daemon should be running on the client machine and BackupPC connects directly to it.</p>
<p>The relevant configuration settings are <a href="#_conf_rsyncdclientport_">$Conf{RsyncdClientPort}</a>, <a href="#_conf_rsyncdusername_">$Conf{RsyncdUserName}</a>, <a href="#_conf_rsyncdpasswd_">$Conf{RsyncdPasswd}</a>, <a href="#_conf_rsyncdauthrequired_">$Conf{RsyncdAuthRequired}</a>, <a href="#_conf_rsyncsharename_">$Conf{RsyncShareName}</a>, <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a>, <a href="#_conf_rsyncargsextra_">$Conf{RsyncArgsExtra}</a>, and <a href="#_conf_rsyncrestoreargs_">$Conf{RsyncRestoreArgs}</a>. <a href="#_conf_rsyncsharename_">$Conf{RsyncShareName}</a> is the name of an rsync module (ie: the thing in square brackets in rsyncd's conf file -- see rsyncd.conf), not a file system path.</p>
<p>Be aware that rsyncd will remove the leading '/' from path names in symbolic links if you specify "use chroot = no" in the rsynd.conf file. See the rsyncd.conf manual page for more information.</p>
</dd>
<dt id="ftp">ftp</dt>
<dd>
<p>You need to be running an ftp server on the client machine. The relevant configuration settings are <a href="#_conf_ftpsharename_">$Conf{FtpShareName}</a>, <a href="#_conf_ftpusername_">$Conf{FtpUserName}</a>, <a href="#_conf_ftppasswd_">$Conf{FtpPasswd}</a>, <a href="#_conf_ftpblocksize_">$Conf{FtpBlockSize}</a>, <a href="#_conf_ftpport_">$Conf{FtpPort}</a>, <a href="#_conf_ftptimeout_">$Conf{FtpTimeout}</a>, and <a href="#_conf_ftpfollowsymlinks_">$Conf{FtpFollowSymlinks}</a>.</p>
</dd>
</dl>
<p>You need to set <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a> to the client's charset so that file names are correctly converted to utf8. Use "locale charmap" on the client to see its charset.</p>
<p>For linux/unix machines you should not backup "/proc". This directory contains a variety of files that look like regular files but they are special files that don't need to be backed up (eg: /proc/kcore is a regular file that contains physical memory). See <a href="#_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a>. It is safe to back up /dev since it contains mostly character-special and block-special files, which are correctly handed by BackupPC (eg: backing up /dev/hda5 just saves the block-special file information, not the contents of the disk).</p>
<p>Alternatively, rather than backup all the file systems as a single share ("/"), it is easier to restore a single file system if you backup each file system separately. To do this you should list each file system mount point in <a href="#_conf_tarsharename_">$Conf{TarShareName}</a> or <a href="#_conf_rsyncsharename_">$Conf{RsyncShareName}</a>, and add the --one-file-system option to <a href="#_conf_tarclientcmd_">$Conf{TarClientCmd}</a> or <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a>. In this case there is no need to exclude /proc explicitly since it looks like a different file system.</p>
<p>Next you should decide whether to run tar over ssh, rsh or nfs. Ssh is the preferred method. Rsh is not secure and therefore not recommended. Nfs will work, but you need to make sure that the BackupPC user (running on the server) has sufficient permissions to read all the files below the nfs mount.</p>
<p>Ssh allows BackupPC to run as a privileged user on the client (eg: root), since it needs sufficient permissions to read all the backup files. Ssh is setup so that BackupPC on the server (an otherwise low privileged user) can ssh as root on the client, without being prompted for a password. There are two common versions of ssh: v1 and v2. Here are some instructions for one way to setup ssh. (Check which version of SSH you have by typing "ssh" or "man ssh".)</p>
</dd>
<dt id="MacOSX">MacOSX</dt>
<dd>
<p>In general this should be similar to Linux/Unix machines. In versions 10.4 and later, the native MacOSX tar works, and also supports resource forks. xtar is another option, and rsync works too (although the MacOSX-supplied rsync has an extension for extended attributes that is not compatible with standard rsync).</p>
</dd>
<dt id="SSH-Setup">SSH Setup</dt>
<dd>
<p>SSH is a secure way to run tar or rsync on a backup client to extract the data. SSH provides strong authentication and encryption of the network data.</p>
<p>Note that if you run rsyncd (rsync daemon), ssh is not used. In this case, rsyncd provides its own authentication, but there is no encryption of network data. If you want encryption of network data you can use ssh to create a tunnel, or use a program like stunnel.</p>
<p>Setup instructions for ssh can be found at <a href="http://backuppc.sourceforge.net/faq/ssh.html">http://backuppc.sourceforge.net/faq/ssh.html</a> or on the Wiki.</p>
</dd>
<dt id="Clients-that-use-DHCP">Clients that use DHCP</dt>
<dd>
<p>If a client machine uses DHCP BackupPC needs some way to find the IP address given the host name. One alternative is to set dhcp to 1 in the hosts file, and BackupPC will search a pool of IP addresses looking for hosts. More efficiently, it is better to set dhcp = 0 and provide a mechanism for BackupPC to find the IP address given the host name.</p>
<p>For WinXX machines BackupPC uses the NetBios name server to determine the IP address given the host name. For unix machines you can run nmbd (the NetBios name server) from the Samba distribution so that the machine responds to a NetBios name request. See the manual page and Samba documentation for more information.</p>
<p>Alternatively, you can set <a href="#_conf_nmblookupfindhostcmd_">$Conf{NmbLookupFindHostCmd}</a> to any command that returns the IP address given the host name.</p>
<p>Please read the section <a href="#How-BackupPC-Finds-Hosts">"How BackupPC Finds Hosts"</a> for more details.</p>
</dd>
</dl>
<h2 id="Step-6:-Running-BackupPC">Step 6: Running BackupPC</h2>
<p>The installation contains an init.d backuppc script that can be copied to /etc/init.d so that BackupPC can auto-start on boot. See init.d/README for further instructions.</p>
<p>BackupPC should be ready to start. If you installed the init.d script, then you should be able to run BackupPC with:</p>
<pre><code> /etc/init.d/backuppc start</code></pre>
<p>(This script can also be invoked with "stop" to stop BackupPC and "reload" to tell BackupPC to reload config.pl and the hosts file.)</p>
<p>Otherwise, just run</p>
<pre><code> /usr/share/backuppc/bin/BackupPC -d</code></pre>
<p>as user backuppc. The -d option tells BackupPC to run as a daemon (ie: it does an additional fork).</p>
<p>Any immediate errors will be printed to stderr and BackupPC will quit. Otherwise, look in /var/lib/backuppc/log/LOG and verify that BackupPC reports it has started and all is ok.</p>
<h2 id="Step-7:-Talking-to-BackupPC">Step 7: Talking to BackupPC</h2>
<p>You should verify that BackupPC is running by using BackupPC_serverMesg. This sends a message to BackupPC via the unix (or TCP) socket and prints the response. Like all BackupPC programs, BackupPC_serverMesg should be run as the BackupPC user (backuppc), so you should</p>
<pre><code> su backuppc</code></pre>
<p>before running BackupPC_serverMesg. If the BackupPC user is configured with /bin/false as the shell, you can use the -s option to su to explicitly run a shell, eg:</p>
<pre><code> su -s /bin/bash backuppc</code></pre>
<p>Depending upon your configuration you might also need the -l option.</p>
<p>You can request status information and start and stop backups using this interface. This socket interface is mainly provided for the CGI interface (and some of the BackupPC sub-programs use it too). But right now we just want to make sure BackupPC is happy. Each of these commands should produce some status output:</p>
<pre><code> /usr/share/backuppc/bin/BackupPC_serverMesg status info
/usr/share/backuppc/bin/BackupPC_serverMesg status jobs
/usr/share/backuppc/bin/BackupPC_serverMesg status hosts</code></pre>
<p>The output should be some hashes printed with Data::Dumper. If it looks cryptic and confusing, and doesn't look like an error message, then all is ok.</p>
<p>The jobs status should initially show just BackupPC_trashClean. The hosts status should produce a list of every host you have listed in /etc/backuppc/hosts as part of a big cryptic output line.</p>
<p>You can also request that all hosts be queued:</p>
<pre><code> /usr/share/backuppc/bin/BackupPC_serverMesg backup all</code></pre>
<p>At this point you should make sure the CGI interface works since it will be much easier to see what is going on. That's our next subject.</p>
<h2 id="Step-8:-Checking-email-delivery">Step 8: Checking email delivery</h2>
<p>The script BackupPC_sendEmail sends status and error emails to the administrator and users. It is usually run each night by BackupPC_nightly.</p>
<p>To verify that it can run sendmail and deliver email correctly you should ask it to send a test email to you:</p>
<pre><code> su backuppc
/usr/share/backuppc/bin/BackupPC_sendEmail -u MYNAME@MYDOMAIN.COM</code></pre>
<p>BackupPC_sendEmail also takes a -c option that checks if BackupPC is running, and it sends an email to <a href="#_conf_emailadminusername_">$Conf{EMailAdminUserName}</a> if it is not. That can be used as a keep-alive check by adding</p>
<pre><code> /usr/share/backuppc/bin/BackupPC_sendEmail -c</code></pre>
<p>to backuppc's cron.</p>
<p>The -t option to BackupPC_sendEmail causes it to print the email message instead of invoking sendmail to deliver the message.</p>
<h2 id="Step-9:-CGI-interface">Step 9: CGI interface</h2>
<p>The CGI interface script, BackupPC_Admin, is a powerful and flexible way to see and control what BackupPC is doing. It is written for an Apache server. If you don't have Apache, see <a href="http://www.apache.org">http://www.apache.org</a>.</p>
<p>There are two options for setting up the CGI interface: standard mode and using mod_perl. Mod_perl provides much higher performance (around 15x) and is the best choice if your Apache was built with mod_perl support. To see if your apache was built with mod_perl run this command:</p>
<pre><code> httpd -l | egrep mod_perl</code></pre>
<p>If this prints mod_perl.c then your Apache supports mod_perl.</p>
<p>Note: on some distributions (like Debian) the command is not ``httpd'', but ``apache'' or ``apache2''. Those distributions will generally also use ``apache'' for the Apache user account and configuration files.</p>
<p>Using mod_perl with BackupPC_Admin requires a dedicated Apache to be run as the BackupPC user (backuppc). This is because BackupPC_Admin needs permission to access various files in BackupPC's data directories. In contrast, the standard installation (without mod_perl) solves this problem by having BackupPC_Admin installed as setuid to the BackupPC user, so that BackupPC_Admin runs as the BackupPC user.</p>
<p>Here are some specifics for each setup:</p>
<dl>
<dt id="Standard-Setup">Standard Setup</dt>
<dd>
<p>The CGI interface should have been installed by the configure.pl script in /usr/share/backuppc/cgi-bin/BackupPC_Admin. BackupPC_Admin should have been installed as setuid to the BackupPC user (backuppc), in addition to user and group execute permission.</p>
<p>You should be very careful about permissions on BackupPC_Admin and the directory /usr/share/backuppc/cgi-bin: it is important that normal users cannot directly execute or change BackupPC_Admin, otherwise they can access backup files for any PC. You might need to change the group ownership of BackupPC_Admin to a group that Apache belongs to so that Apache can execute it (don't add "other" execute permission!). The permissions should look like this:</p>
<pre><code> ls -l /usr/share/backuppc/cgi-bin/BackupPC_Admin
-swxr-x--- 1 backuppc web 82406 Jun 17 22:58 /usr/share/backuppc/cgi-bin/BackupPC_Admin</code></pre>
<p>The setuid script won't work unless perl on your machine was installed with setuid emulation. This is likely the problem if you get an error saying such as "Wrong user: my userid is 25, instead of 150", meaning the script is running as the httpd user, not the BackupPC user. This is because setuid scripts are disabled by the kernel in most flavors of unix and linux.</p>
<p>To see if your perl has setuid emulation, see if there is a program called sperl5.8.0 (or sperl5.8.2 etc, based on your perl version) in the place where perl is installed. If you can't find this program, then you have two options: rebuild and reinstall perl with the setuid emulation turned on (answer "y" to the question "Do you want to do setuid/setgid emulation?" when you run perl's configure script), or switch to the mod_perl alternative for the CGI script (which doesn't need setuid to work).</p>
</dd>
<dt id="Mod_perl-Setup">Mod_perl Setup</dt>
<dd>
<p>The advantage of the mod_perl setup is that no setuid script is needed, and there is a huge performance advantage. Not only does all the perl code need to be parsed just once, the config.pl and hosts files, plus the connection to the BackupPC server are cached between requests. The typical speedup is around 15 times.</p>
<p>To use mod_perl you need to run Apache as user backuppc. If you need to run multiple Apache's for different services then you need to create multiple top-level Apache directories, each with their own config file. You can make copies of /etc/init.d/httpd and use the -d option to httpd to point each http to a different top-level directory. Or you can use the -f option to explicitly point to the config file. Multiple Apache's will run on different Ports (eg: 80 is standard, 8080 is a typical alternative port accessed via http://yourhost.com:8080).</p>
<p>Inside BackupPC's Apache http.conf file you should check the settings for ServerRoot, DocumentRoot, User, Group, and Port. See <a href="http://httpd.apache.org/docs/server-wide.html">http://httpd.apache.org/docs/server-wide.html</a> for more details.</p>
<p>For mod_perl, BackupPC_Admin should not have setuid permission, so you should turn it off:</p>
<pre><code> chmod u-s /usr/share/backuppc/cgi-bin/BackupPC_Admin</code></pre>
<p>To tell Apache to use mod_perl to execute BackupPC_Admin, add this to Apache's 1.x httpd.conf file:</p>
<pre><code> <IfModule mod_perl.c>
PerlModule Apache::Registry
PerlTaintCheck On
<Location /cgi-bin/BackupPC/BackupPC_Admin> # <--- change path as needed
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
PerlSendHeader On
</Location>
</IfModule></code></pre>
<p>Apache 2.0.44 with Perl 5.8.0 on RedHat 7.1, Don Silvia reports that this works (with tweaks from Michael Tuzi):</p>
<pre><code> LoadModule perl_module modules/mod_perl.so
PerlModule Apache2
<Directory /path/to/cgi/>
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
Order deny,allow
Deny from all
Allow from 192.168.0
AuthName "Backup Admin"
AuthType Basic
AuthUserFile /path/to/user_file
Require valid-user
</Directory></code></pre>
<p>There are other optimizations and options with mod_perl. For example, you can tell mod_perl to preload various perl modules, which saves memory compared to loading separate copies in every Apache process after they are forked. See Stas's definitive mod_perl guide at <a href="http://perl.apache.org/guide">http://perl.apache.org/guide</a>.</p>
</dd>
</dl>
<p>BackupPC_Admin requires that users are authenticated by Apache. Specifically, it expects that Apache sets the REMOTE_USER environment variable when it runs. There are several ways to do this. One way is to create a .htaccess file in the cgi-bin directory that looks like:</p>
<pre><code> AuthGroupFile /etc/httpd/conf/group # <--- change path as needed
AuthUserFile /etc/http/conf/passwd # <--- change path as needed
AuthType basic
AuthName "access"
require valid-user</code></pre>
<p>You will also need "AllowOverride Indexes AuthConfig" in the Apache httpd.conf file to enable the .htaccess file. Alternatively, everything can go in the Apache httpd.conf file inside a Location directive. The list of users and password file above can be extracted from the NIS passwd file.</p>
<p>One alternative is to use LDAP. In Apache's http.conf add these lines:</p>
<pre><code> LoadModule auth_ldap_module modules/auth_ldap.so
AddModule auth_ldap.c
# cgi-bin - auth via LDAP (for BackupPC)
<Location /cgi-binBackupPC/BackupPC_Admin> # <--- change path as needed
AuthType Basic
AuthName "BackupPC login"
# replace MYDOMAIN, PORT, ORG and CO as needed
AuthLDAPURL ldap://ldap.MYDOMAIN.com:PORT/o=ORG,c=CO?uid?sub?(objectClass=*)
require valid-user
</Location></code></pre>
<p>If you want to disable the user authentication you can set <a href="#_conf_cgiadminusers_">$Conf{CgiAdminUsers}</a> to '*', which allows any user to have full access to all hosts and backups. In this case the REMOTE_USER environment variable does not have to be set by Apache.</p>
<p>Alternatively, you can force a particular user name by getting Apache to set REMOTE_USER, eg, to hardcode the user to www you could add this to Apache's httpd.conf:</p>
<pre><code> <Location /cgi-bin/BackupPC/BackupPC_Admin> # <--- change path as needed
Setenv REMOTE_USER www
</Location></code></pre>
<p>Finally, you should also edit the config.pl file and adjust, as necessary, the CGI-specific settings. They're near the end of the config file. In particular, you should specify which users or groups have administrator (privileged) access: see the config settings <a href="#_conf_cgiadminusergroup_">$Conf{CgiAdminUserGroup}</a> and <a href="#_conf_cgiadminusers_">$Conf{CgiAdminUsers}</a>. Also, the configure.pl script placed various images into <a href="#_conf_cgiimagedir_">$Conf{CgiImageDir}</a> that BackupPC_Admin needs to serve up. You should make sure that <a href="#_conf_cgiimagedirurl_">$Conf{CgiImageDirURL}</a> is the correct URL for the image directory.</p>
<p>See the section <a href="#Fixing-installation-problems">"Fixing installation problems"</a> for suggestions on debugging the Apache authentication setup.</p>
<h2 id="How-BackupPC-Finds-Hosts">How BackupPC Finds Hosts</h2>
<p>Starting with v2.0.0 the way hosts are discovered has changed. In most cases you should specify 0 for the DHCP flag in the conf/hosts file, even if the host has a dynamically assigned IP address.</p>
<p>BackupPC (starting with v2.0.0) looks up hosts with DHCP = 0 in this manner:</p>
<ul>
<li><p>First DNS is used to lookup the IP address given the client's name using perl's gethostbyname() function. This should succeed for machines that have fixed IP addresses that are known via DNS. You can manually see whether a given host have a DNS entry according to perl's gethostbyname function with this command:</p>
<pre><code> perl -e 'print(gethostbyname("myhost") ? "ok\n" : "not found\n");'</code></pre>
</li>
<li><p>If gethostbyname() fails, BackupPC then attempts a NetBios multicast to find the host. Provided your client machine is configured properly, it should respond to this NetBios multicast request. Specifically, BackupPC runs a command of this form:</p>
<pre><code> nmblookup myhost</code></pre>
<p>If this fails you will see output like:</p>
<pre><code> querying myhost on 10.10.255.255
name_query failed to find name myhost</code></pre>
<p>If it is successful you will see output like:</p>
<pre><code> querying myhost on 10.10.255.255
10.10.1.73 myhost<00></code></pre>
<p>Depending on your netmask you might need to specify the -B option to nmblookup. For example:</p>
<pre><code> nmblookup -B 10.10.1.255 myhost</code></pre>
<p>If necessary, experiment with the nmblookup command which will return the IP address of the client given its name. Then update <a href="#_conf_nmblookupfindhostcmd_">$Conf{NmbLookupFindHostCmd}</a> with any necessary options to nmblookup.</p>
</li>
</ul>
<p>For hosts that have the DHCP flag set to 1, these machines are discovered as follows:</p>
<ul>
<li><p>A DHCP address pool (<a href="#_conf_dhcpaddressranges_">$Conf{DHCPAddressRanges}</a>) needs to be specified. BackupPC will check the NetBIOS name of each machine in the range using a command of the form:</p>
<pre><code> nmblookup -A W.X.Y.Z</code></pre>
<p>where W.X.Y.Z is each candidate address from <a href="#_conf_dhcpaddressranges_">$Conf{DHCPAddressRanges}</a>. Any host that has a valid NetBIOS name returned by this command (ie: matching an entry in the hosts file) will be backed up. You can modify the specific nmblookup command if necessary via <a href="#_conf_nmblookupcmd_">$Conf{NmbLookupCmd}</a>.</p>
</li>
<li><p>You only need to use this DHCP feature if your client machine doesn't respond to the NetBios multicast request:</p>
<pre><code> nmblookup myHost</code></pre>
<p>but does respond to a request directed to its IP address:</p>
<pre><code> nmblookup -A W.X.Y.Z</code></pre>
</li>
</ul>
<h2 id="Other-installation-topics">Other installation topics</h2>
<dl>
<dt id="Removing-a-client">Removing a client</dt>
<dd>
<p>If there is a machine that no longer needs to be backed up (eg: a retired machine) you have two choices. First, you can keep the backups accessible and browsable, but disable all new backups. Alternatively, you can completely remove the client and all its backups.</p>
<p>To disable backups for a client <a href="#_conf_backupsdisable_">$Conf{BackupsDisable}</a> can be set to two different values in that client's per-PC config.pl file:</p>
<ol>
<li><p>Don't do any regular backups on this machine. Manually requested backups (via the CGI interface) will still occur.</p>
</li>
<li><p>Don't do any backups on this machine. Manually requested backups (via the CGI interface) will be ignored.</p>
</li>
</ol>
<p>This will still allow the client's old backups to be browsable and restorable.</p>
<p>To completely remove a client and all its backups, you should remove its entry in the conf/hosts file, and then delete the /var/lib/backuppc/pc/$host directory. Whenever you change the hosts file, you should send BackupPC a HUP (-1) signal so that it re-reads the hosts file. If you don't do this, BackupPC will automatically re-read the hosts file at the next regular wakeup.</p>
<p>Note that when you remove a client's backups you won't initially recover much disk space. That's because the client's files are still in the pool. Overnight, when BackupPC_nightly next runs, all the unused pool files will be deleted and this will recover the disk space used by the client's backups.</p>
</dd>
<dt id="Copying-the-pool">Copying the pool</dt>
<dd>
<p>If the pool disk requirements grow you might need to copy the entire data directory to a new (bigger) file system. Hopefully you are lucky enough to avoid this by having the data directory on a RAID file system or LVM that allows the capacity to be grown in place by adding disks.</p>
<p>The backup data directories contain large numbers of hardlinks. If you try to copy the pool the target directory will occupy a lot more space if the hardlinks aren't re-established.</p>
<p>The best way to copy a pool file system, if possible, is by copying the raw device at the block level (eg: using dd). Application level programs that understand hardlinks include the GNU cp program with the -a option and rsync -H. However, the large number of hardlinks in the pool will make the memory usage large and the copy very slow. Don't forget to stop BackupPC while the copy runs.</p>
<p>Starting in 3.0.0 a new script bin/BackupPC_tarPCCopy can be used to assist the copy process. Given one or more pc paths (eg: TOPDIR/pc/HOST or TOPDIR/pc/HOST/nnn), BackupPC_tarPCCopy creates a tar archive with all the hardlinks pointing to ../cpool/.... Any files not hardlinked (eg: backups, LOG etc) are included verbatim.</p>
<p>You will need to specify the -P option to tar when you extract the archive generated by BackupPC_tarPCCopy since the hardlink targets are outside of the directory being extracted.</p>
<p>To copy a complete store (ie: /var/lib/backuppc) using BackupPC_tarPCCopy you should:</p>
<ul>
<li><p>stop BackupPC so that the store is static.</p>
</li>
<li><p>copy the cpool, conf and log directory trees using any technique (like cp, rsync or tar) without the need to preserve hardlinks.</p>
</li>
<li><p>copy the pc directory using BackupPC_tarPCCopy:</p>
<pre><code> su backuppc
cd NEW_TOPDIR
mkdir pc
cd pc
/usr/share/backuppc/bin/BackupPC_tarPCCopy /var/lib/backuppc/pc | tar xvPf -</code></pre>
</li>
</ul>
</dd>
</dl>
<h2 id="Fixing-installation-problems">Fixing installation problems</h2>
<p>Please see the Wiki at <a href="http://backuppc.wiki.sourceforge.net">http://backuppc.wiki.sourceforge.net</a> for debugging suggestions. If you find a solution to your problem that could help other users please add it to the Wiki!</p>
<hr />
<h1 id="Restore-functions">Restore functions</h1>
<p>BackupPC supports several different methods for restoring files. The most convenient restore options are provided via the CGI interface. Alternatively, backup files can be restored using manual commands.</p>
<h2 id="CGI-restore-options">CGI restore options</h2>
<p>By selecting a host in the CGI interface, a list of all the backups for that machine will be displayed. By selecting the backup number you can navigate the shares and directory tree for that backup.</p>
<p>BackupPC's CGI interface automatically fills incremental backups with the corresponding full backup, which means each backup has a filled appearance. Therefore, there is no need to do multiple restores from the incremental and full backups: BackupPC does all the hard work for you. You simply select the files and directories you want from the correct backup vintage in one step.</p>
<p>You can download a single backup file at any time simply by selecting it. Your browser should prompt you with the file name and ask you whether to open the file or save it to disk.</p>
<p>Alternatively, you can select one or more files or directories in the currently selected directory and select "Restore selected files". (If you need to restore selected files and directories from several different parent directories you will need to do that in multiple steps.)</p>
<p>If you select all the files in a directory, BackupPC will replace the list of files with the parent directory. You will be presented with a screen that has three options:</p>
<dl>
<dt id="Option-1:-Direct-Restore">Option 1: Direct Restore</dt>
<dd>
<p>With this option the selected files and directories are restored directly back onto the host, by default in their original location. Any old files with the same name will be overwritten, so use caution. You can optionally change the target host name, target share name, and target path prefix for the restore, allowing you to restore the files to a different location.</p>
<p>Once you select "Start Restore" you will be prompted one last time with a summary of the exact source and target files and directories before you commit. When you give the final go ahead the restore operation will be queued like a normal backup job, meaning that it will be deferred if there is a backup currently running for that host. When the restore job is run, smbclient, tar, rsync or rsyncd is used (depending upon <a href="#_conf_xfermethod_">$Conf{XferMethod}</a>) to actually restore the files. Sorry, there is currently no option to cancel a restore that has been started. Currently ftp restores are not fully implemented.</p>
<p>A record of the restore request, including the result and list of files and directories, is kept. It can be browsed from the host's home page. <a href="#_conf_restoreinfokeepcnt_">$Conf{RestoreInfoKeepCnt}</a> specifies how many old restore status files to keep.</p>
<p>Note that for direct restore to work, the <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> must be able to write to the client. For example, that means an SMB share for smbclient needs to be writable, and the rsyncd module needs "read only" set to "false". This creates additional security risks. If you only create read-only SMB shares (which is a good idea), then the direct restore will fail. You can disable the direct restore option by setting <a href="#_conf_smbclientrestorecmd_">$Conf{SmbClientRestoreCmd}</a>, <a href="#_conf_tarclientrestorecmd_">$Conf{TarClientRestoreCmd}</a> and <a href="#_conf_rsyncrestoreargs_">$Conf{RsyncRestoreArgs}</a> to undef.</p>
</dd>
<dt id="Option-2:-Download-Zip-archive">Option 2: Download Zip archive</dt>
<dd>
<p>With this option a zip file containing the selected files and directories is downloaded. The zip file can then be unpacked or individual files extracted as necessary on the host machine. The compression level can be specified. A value of 0 turns off compression.</p>
<p>When you select "Download Zip File" you should be prompted where to save the restore.zip file.</p>
<p>BackupPC does not consider downloading a zip file as an actual restore operation, so the details are not saved for later browsing as in the first case. However, a mention that a zip file was downloaded by a particular user, and a list of the files, does appear in BackupPC's log file.</p>
</dd>
<dt id="Option-3:-Download-Tar-archive">Option 3: Download Tar archive</dt>
<dd>
<p>This is identical to the previous option, except a tar file is downloaded rather than a zip file (and there is currently no compression option).</p>
</dd>
</dl>
<h2 id="Command-line-restore-options">Command-line restore options</h2>
<p>Apart from the CGI interface, BackupPC allows you to restore files and directories from the command line. The following programs can be used:</p>
<dl>
<dt id="BackupPC_zcat">BackupPC_zcat</dt>
<dd>
<p>For each file name argument it inflates (uncompresses) the file and writes it to stdout. To use BackupPC_zcat you could give it the full file name, eg:</p>
<pre><code> /usr/share/backuppc/bin/BackupPC_zcat /var/lib/backuppc/pc/host/5/fc/fcraig/fexample.txt > example.txt</code></pre>
<p>It's your responsibility to make sure the file is really compressed: BackupPC_zcat doesn't check which backup the requested file is from. BackupPC_zcat returns a non-zero status if it fails to uncompress a file.</p>
</dd>
<dt id="BackupPC_tarCreate">BackupPC_tarCreate</dt>
<dd>
<p>BackupPC_tarCreate creates a tar file for any files or directories in a particular backup. Merging of incrementals is done automatically, so you don't need to worry about whether certain files appear in the incremental or full backup.</p>
<p>The usage is:</p>
<pre><code> BackupPC_tarCreate [options] files/directories...
Required options:
-h host host from which the tar archive is created
-n dumpNum dump number from which the tar archive is created
A negative number means relative to the end (eg -1
means the most recent dump, -2 2nd most recent etc).
-s shareName share name from which the tar archive is created
Other options:
-t print summary totals
-r pathRemove path prefix that will be replaced with pathAdd
-p pathAdd new path prefix
-b BLOCKS BLOCKS x 512 bytes per record (default 20; same as tar)
-w writeBufSz write buffer size (default 1048576 = 1MB)
-e charset charset for encoding file names (default: value of
<a href="#_conf_clientcharset_">$Conf{ClientCharset}</a> when backup was done)
-l just print a file listing; don't generate an archive
-L just print a detailed file listing; don't generate an archive</code></pre>
<p>The command-line files and directories are relative to the specified shareName. The tar file is written to stdout.</p>
<p>The -h, -n and -s options specify which dump is used to generate the tar archive. The -r and -p options can be used to relocate the paths in the tar archive so extracted files can be placed in a location different from their original location.</p>
</dd>
<dt id="BackupPC_zipCreate">BackupPC_zipCreate</dt>
<dd>
<p>BackupPC_zipCreate creates a zip file for any files or directories in a particular backup. Merging of incrementals is done automatically, so you don't need to worry about whether certain files appear in the incremental or full backup.</p>
<p>The usage is:</p>
<pre><code> BackupPC_zipCreate [options] files/directories...
Required options:
-h host host from which the zip archive is created
-n dumpNum dump number from which the tar archive is created
A negative number means relative to the end (eg -1
means the most recent dump, -2 2nd most recent etc).
-s shareName share name from which the zip archive is created
Other options:
-t print summary totals
-r pathRemove path prefix that will be replaced with pathAdd
-p pathAdd new path prefix
-c level compression level (default is 0, no compression)
-e charset charset for encoding file names (default: utf8)</code></pre>
<p>The command-line files and directories are relative to the specified shareName. The zip file is written to stdout. The -h, -n and -s options specify which dump is used to generate the zip archive. The -r and -p options can be used to relocate the paths in the zip archive so extracted files can be placed in a location different from their original location.</p>
</dd>
</dl>
<p>Each of these programs reside in /usr/share/backuppc/bin.</p>
<hr />
<h1 id="Archive-functions">Archive functions</h1>
<p>BackupPC supports archiving to removable media. For users that require offsite backups, BackupPC can create archives that stream to tape devices, or create files of specified sizes to fit onto cd or dvd media.</p>
<p>Each archive type is specified by a BackupPC host with its XferMethod set to 'archive'. This allows for multiple configurations at sites where there might be a combination of tape and cd/dvd backups being made.</p>
<p>BackupPC provides a menu that allows one or more hosts to be archived. The most recent backup of each host is archived using BackupPC_tarCreate, and the output is optionally compressed and split into fixed-sized files (eg: 650MB).</p>
<p>The archive for each host is done by default using /usr/share/backuppc/bin/BackupPC_archiveHost. This script can be copied and customized as needed.</p>
<h2 id="Configuring-an-Archive-Host">Configuring an Archive Host</h2>
<p>To create an Archive Host, add it to the hosts file just as any other host and call it a name that best describes the type of archive, e.g. ArchiveDLT</p>
<p>To tell BackupPC that the Host is for Archives, create a config.pl file in the Archive Hosts's pc directory, adding the following line:</p>
<p><a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'archive';</p>
<p>To further customise the archive's parameters you can adding the changed parameters in the host's config.pl file. The parameters are explained in the config.pl file. Parameters may be fixed or the user can be allowed to change them (eg: output device).</p>
<p>The per-host archive command is <a href="#_conf_archiveclientcmd_">$Conf{ArchiveClientCmd}</a>. By default this invokes</p>
<pre><code> /usr/share/backuppc/bin/BackupPC_archiveHost</code></pre>
<p>which you can copy and customize as necessary.</p>
<h2 id="Starting-an-Archive">Starting an Archive</h2>
<p>In the web interface, click on the Archive Host you wish to use. You will see a list of previous archives and a summary on each. By clicking the "Start Archive" button you are presented with the list of hosts and the approximate backup size (note this is raw size, not projected compressed size) Select the hosts you wish to archive and press the "Archive Selected Hosts" button.</p>
<p>The next screen allows you to adjust the parameters for this archive run. Press the "Start the Archive" to start archiving the selected hosts with the parameters displayed.</p>
<h2 id="Starting-an-Archive-from-the-command-line">Starting an Archive from the command line</h2>
<p>The script BackupPC_archiveStart can be used to start an archive from the command line (or cron etc). The usage is:</p>
<pre><code> BackupPC_archiveStart archiveHost userName hosts...</code></pre>
<p>This creates an archive of the most recent backup of each of the specified hosts. The first two arguments are the archive host and the user name making the request.</p>
<hr />
<h1 id="Other-CGI-Functions">Other CGI Functions</h1>
<h2 id="Configuration-and-Host-Editor">Configuration and Host Editor</h2>
<p>The CGI interface has a complete configuration and host editor. Only the administrator can edit the main configuration settings and hosts. The edit links are in the left navigation bar.</p>
<p>When changes are made to any parameter a "Save" button appears at the top of the page. If you are editing a text box you will need to click outside of the text box to make the Save button appear. If you don't select Save then the changes won't be saved.</p>
<p>The host-specific configuration can be edited from the host summary page using the link in the left navigation bar. The administrator can edit any of the host-specific configuration settings.</p>
<p>When editing the host-specific configuration, each parameter has an "override" setting that denotes the value is host-specific, meaning that it overrides the setting in the main configuration. If you unselect "override" then the setting is removed from the host-specific configuration, and the main configuration file is displayed.</p>
<p>User's can edit their host-specific configuration if enabled via <a href="#_conf_cgiuserconfigeditenable_">$Conf{CgiUserConfigEditEnable}</a>. The specific subset of configuration settings that a user can edit is specified with <a href="#_conf_cgiuserconfigedit_">$Conf{CgiUserConfigEdit}</a>. It is recommended to make this list short as possible (you probably don't want your users saving dozens of backups) and it is essential that they can't edit any of the Cmd configuration settings, otherwise they can specify an arbitrary command that will be executed as the BackupPC user.</p>
<h2 id="RSS">RSS</h2>
<p>BackupPC supports a very basic RSS feed. Provided you have the XML::RSS perl module installed, a URL similar to this will provide RSS information:</p>
<pre><code> http://localhost/cgi-bin/BackupPC/BackupPC_Admin?action=rss</code></pre>
<p>This feature is experimental. The information included will probably change.</p>
<hr />
<h1 id="BackupPC-Design">BackupPC Design</h1>
<h2 id="Some-design-issues">Some design issues</h2>
<dl>
<dt id="Pooling-common-files">Pooling common files</dt>
<dd>
<p>To quickly see if a file is already in the pool, an MD5 digest of the file length and contents is used as the file name in the pool. This can't guarantee a file is identical: it just reduces the search to often a single file or handful of files. A complete file comparison is always done to verify if two files are really the same.</p>
<p>Identical files on multiples backups are represented by hard links. Hardlinks are used so that identical files all refer to the same physical file on the server's disk. Also, hard links maintain reference counts so that BackupPC knows when to delete unused files from the pool.</p>
<p>For the computer-science majors among you, you can think of the pooling system used by BackupPC as just a chained hash table stored on a (big) file system.</p>
</dd>
<dt id="The-hashing-function">The hashing function</dt>
<dd>
<p>There is a tradeoff between how much of file is used for the MD5 digest and the time taken comparing all the files that have the same hash.</p>
<p>Using the file length and just the first 4096 bytes of the file for the MD5 digest produces some repetitions. One example: with 900,000 unique files in the pool, this hash gives about 7,000 repeated files, and in the worst case 500 files have the same hash. That's not bad: we only have to do a single file compare 99.2% of the time. But in the worst case we have to compare as many as 500 files checking for a match.</p>
<p>With a modest increase in CPU time, if we use the file length and the first 256K of the file we now only have 500 repeated files and in the worst case around 20 files have the same hash. Furthermore, if we instead use the first and last 128K of the file (more specifically, the first and eighth 128K chunks for files larger than 1MB) we get only 300 repeated files and in the worst case around 20 files have the same hash.</p>
<p>Based on this experimentation, this is the hash function used by BackupPC. It is important that you don't change the hash function after files are already in the pool. Otherwise your pool will grow to twice the size until all the old backups (and all the old files with old hashes) eventually expire.</p>
</dd>
<dt id="Compression">Compression</dt>
<dd>
<p>BackupPC supports compression. It uses the deflate and inflate methods in the Compress::Zlib module, which is based on the zlib compression library (see <a href="http://www.gzip.org/zlib/">http://www.gzip.org/zlib/</a>).</p>
<p>The <a href="#_conf_compresslevel_">$Conf{CompressLevel}</a> setting specifies the compression level to use. Zero (0) means no compression. Compression levels can be from 1 (least cpu time, slightly worse compression) to 9 (most cpu time, slightly better compression). The recommended value is 3. Changing it to 5, for example, will take maybe 20% more cpu time and will get another 2-3% additional compression. Diminishing returns set in above 5. See the zlib documentation for more information about compression levels.</p>
<p>BackupPC implements compression with minimal CPU load. Rather than compressing every incoming backup file and then trying to match it against the pool, BackupPC computes the MD5 digest based on the uncompressed file, and matches against the candidate pool files by comparing each uncompressed pool file against the incoming backup file. Since inflating a file takes roughly a factor of 10 less CPU time than deflating there is a big saving in CPU time.</p>
<p>The combination of pooling common files and compression can yield a factor of 8 or more overall saving in backup storage.</p>
</dd>
</dl>
<h2 id="BackupPC-operation">BackupPC operation</h2>
<p>BackupPC reads the configuration information from /etc/backuppc/config.pl. It then runs and manages all the backup activity. It maintains queues of pending backup requests, user backup requests and administrative commands. Based on the configuration various requests will be executed simultaneously.</p>
<p>As specified by <a href="#_conf_wakeupschedule_">$Conf{WakeupSchedule}</a>, BackupPC wakes up periodically to queue backups on all the PCs. This is a four step process:</p>
<ol>
<li><p>For each host and DHCP address backup requests are queued on the background command queue.</p>
</li>
<li><p>For each PC, BackupPC_dump is forked. Several of these may be run in parallel, based on the configuration. First a ping is done to see if the machine is alive. If this is a DHCP address, nmblookup is run to get the netbios name, which is used as the host name. If DNS lookup fails, <a href="#_conf_nmblookupfindhostcmd_">$Conf{NmbLookupFindHostCmd}</a> is run to find the IP address from the host name. The file /var/lib/backuppc/pc/$host/backups is read to decide whether a full or incremental backup needs to be run. If no backup is scheduled, or the ping to $host fails, then BackupPC_dump exits.</p>
<p>The backup is done using the specified XferMethod. Either samba's smbclient or tar over ssh/rsh/nfs piped into BackupPC_tarExtract, or rsync over ssh/rsh is run, or rsyncd is connected to, with the incoming data extracted to /var/lib/backuppc/pc/$host/new. The XferMethod output is put into /var/lib/backuppc/pc/$host/XferLOG.</p>
<p>The letter in the XferLOG file shows the type of object, similar to the first letter of the modes displayed by ls -l:</p>
<pre><code> d -> directory
l -> symbolic link
b -> block special file
c -> character special file
p -> pipe file (fifo)
nothing -> regular file</code></pre>
<p>The words mean:</p>
<dl>
<dt id="create">create</dt>
<dd>
<p>new for this backup (ie: directory or file not in pool)</p>
</dd>
<dt id="pool">pool</dt>
<dd>
<p>found a match in the pool</p>
</dd>
<dt id="same">same</dt>
<dd>
<p>file is identical to previous backup (contents were checksummed and verified during full dump).</p>
</dd>
<dt id="skip">skip</dt>
<dd>
<p>file skipped in incremental because attributes are the same (only displayed if <a href="#_conf_xferloglevel_">$Conf{XferLogLevel}</a> >= 2).</p>
</dd>
</dl>
<p>As BackupPC_tarExtract extracts the files from smbclient or tar, or as rsync or ftp runs, it checks each file in the backup to see if it is identical to an existing file from any previous backup of any PC. It does this without needed to write the file to disk. If the file matches an existing file, a hardlink is created to the existing file in the pool. If the file does not match any existing files, the file is written to disk and the file name is saved in /var/lib/backuppc/pc/$host/NewFileList for later processing by BackupPC_link. BackupPC_tarExtract and rsync can handle arbitrarily large files and multiple candidate matching files without needing to write the file to disk in the case of a match. This significantly reduces disk writes (and also reads, since the pool file comparison is done disk to memory, rather than disk to disk).</p>
<p>Based on the configuration settings, BackupPC_dump checks each old backup to see if any should be removed. Any expired backups are moved to /var/lib/backuppc/trash for later removal by BackupPC_trashClean.</p>
</li>
<li><p>For each complete, good, backup, BackupPC_link is run. To avoid race conditions as new files are linked into the pool area, only a single BackupPC_link program runs at a time and the rest are queued.</p>
<p>BackupPC_link reads the NewFileList written by BackupPC_dump and inspects each new file in the backup. It re-checks if there is a matching file in the pool (another BackupPC_link could have added the file since BackupPC_dump checked). If so, the file is removed and replaced by a hard link to the existing file. If the file is new, a hard link to the file is made in the pool area, so that this file is available for checking against each new file and new backup.</p>
<p>Then, if <a href="#_conf_incrfill_">$Conf{IncrFill}</a> is set (note that the default setting is off), for each incremental backup, hard links are made in the new backup to all files that were not extracted during the incremental backups. The means the incremental backup looks like a complete image of the PC (with the exception that files that were removed on the PC since the last full backup will still appear in the backup directory tree).</p>
<p>The CGI interface knows how to merge unfilled incremental backups will the most recent prior filled (full) backup, giving the incremental backups a filled appearance. The default for <a href="#_conf_incrfill_">$Conf{IncrFill}</a> is off, since there is no need to fill incremental backups. This saves some level of disk activity, since lots of extra hardlinks are no longer needed (and don't have to be deleted when the backup expires).</p>
</li>
<li><p>BackupPC_trashClean is always run in the background to remove any expired backups. Every 5 minutes it wakes up and removes all the files in /var/lib/backuppc/trash.</p>
<p>Also, once each night, BackupPC_nightly is run to complete some additional administrative tasks, such as cleaning the pool. This involves removing any files in the pool that only have a single hard link (meaning no backups are using that file). Again, to avoid race conditions, BackupPC_nightly is only run when there are no BackupPC_link processes running. When BackupPC_nightly is run no new BackupPC_link jobs are started. If BackupPC_nightly takes too long to run, the settings <a href="#_conf_maxbackuppcnightlyjobs_">$Conf{MaxBackupPCNightlyJobs}</a> and <a href="#_conf_backuppcnightlyperiod_">$Conf{BackupPCNightlyPeriod}</a> can be used to run several BackupPC_nightly processes in parallel, and to split its job over several nights.</p>
</li>
</ol>
<p>BackupPC also listens for TCP connections on <a href="#_conf_serverport_">$Conf{ServerPort}</a>, which is used by the CGI script BackupPC_Admin for status reporting and user-initiated backup or backup cancel requests.</p>
<h2 id="Storage-layout">Storage layout</h2>
<p>BackupPC resides in several directories:</p>
<dl>
<dt id="INSTALLDIR__">/usr/share/backuppc</dt>
<dd>
<p>Perl scripts comprising BackupPC reside in /usr/share/backuppc/bin, libraries are in /usr/share/backuppc/lib and documentation is in /usr/share/backuppc/doc.</p>
</dd>
<dt id="CGIDIR__">/usr/share/backuppc/cgi-bin</dt>
<dd>
<p>The CGI script BackupPC_Admin resides in this cgi binary directory.</p>
</dd>
<dt id="CONFDIR__">/etc/backuppc</dt>
<dd>
<p>All the configuration information resides below /etc/backuppc. This directory contains:</p>
<p>The directory /etc/backuppc contains:</p>
<dl>
<dt id="config.pl">config.pl</dt>
<dd>
<p>Configuration file. See <a href="#Configuration-File">"Configuration File"</a> below for more details.</p>
</dd>
<dt id="hosts">hosts</dt>
<dd>
<p>Hosts file, which lists all the PCs to backup.</p>
</dd>
<dt id="pc">pc</dt>
<dd>
<p>The directory /etc/backuppc/pc contains per-client configuration files that override settings in the main configuration file. Each file is named /etc/backuppc/pc/HOST.pl, where HOST is the host name.</p>
<p>In pre-FHS versions of BackupPC these files were located in /var/lib/backuppc/pc/HOST/config.pl.</p>
</dd>
</dl>
</dd>
<dt id="LOGDIR__">/var/lib/backuppc/log</dt>
<dd>
<p>The directory /var/lib/backuppc/log (/var/lib/backuppc/log on pre-FHS versions of BackupPC) contains:</p>
<dl>
<dt id="LOG">LOG</dt>
<dd>
<p>Current (today's) log file output from BackupPC.</p>
</dd>
<dt id="LOG.0-or-LOG.0.z">LOG.0 or LOG.0.z</dt>
<dd>
<p>Yesterday's log file output. Log files are aged daily and compressed (if compression is enabled), and old LOG files are deleted.</p>
</dd>
<dt id="BackupPC.pid">BackupPC.pid</dt>
<dd>
<p>Contains BackupPC's process id.</p>
</dd>
<dt id="status.pl">status.pl</dt>
<dd>
<p>A summary of BackupPC's status written periodically by BackupPC so that certain state information can be maintained if BackupPC is restarted. Should not be edited.</p>
</dd>
<dt id="UserEmailInfo.pl">UserEmailInfo.pl</dt>
<dd>
<p>A summary of what email was last sent to each user, and when the last email was sent. Should not be edited.</p>
</dd>
</dl>
</dd>
<dt id="TOPDIR__">/var/lib/backuppc</dt>
<dd>
<p>All of BackupPC's data (PC backup images, logs, configuration information) is stored below this directory.</p>
<p>Below /var/lib/backuppc are several directories:</p>
<dl>
<dt id="TOPDIR__-trash">/var/lib/backuppc/trash</dt>
<dd>
<p>Any directories and files below this directory are periodically deleted whenever BackupPC_trashClean checks. When a backup is aborted or when an old backup expires, BackupPC_dump simply moves the directory to /var/lib/backuppc/trash for later removal by BackupPC_trashClean.</p>
</dd>
<dt id="TOPDIR__-pool">/var/lib/backuppc/pool</dt>
<dd>
<p>All uncompressed files from PC backups are stored below /var/lib/backuppc/pool. Each file's name is based on the MD5 hex digest of the file contents. Specifically, for files less than 256K, the file length and the entire file is used. For files up to 1MB, the file length and the first and last 128K are used. Finally, for files longer than 1MB, the file length, and the first and eighth 128K chunks for the file are used.</p>
<p>Each file is stored in a subdirectory X/Y/Z, where X, Y, Z are the first 3 hex digits of the MD5 digest.</p>
<p>For example, if a file has an MD5 digest of 123456789abcdef0, the file is stored in /var/lib/backuppc/pool/1/2/3/123456789abcdef0.</p>
<p>The MD5 digest might not be unique (especially since not all the file's contents are used for files bigger than 256K). Different files that have the same MD5 digest are stored with a trailing suffix "_n" where n is an incrementing number starting at 0. So, for example, if two additional files were identical to the first, except the last byte was different, and assuming the file was larger than 1MB (so the MD5 digests are the same but the files are actually different), the three files would be stored as:</p>
<pre><code> /var/lib/backuppc/pool/1/2/3/123456789abcdef0
/var/lib/backuppc/pool/1/2/3/123456789abcdef0_0
/var/lib/backuppc/pool/1/2/3/123456789abcdef0_1</code></pre>
<p>Both BackupPC_dump (actually, BackupPC_tarExtract) and BackupPC_link are responsible for checking newly backed up files against the pool. For each file, the MD5 digest is used to generate a file name in the pool directory. If the file exists in the pool, the contents are compared. If there is no match, additional files ending in "_n" are checked. (Actually, BackupPC_tarExtract compares multiple candidate files in parallel.) If the file contents exactly match, the file is created by simply making a hard link to the pool file (this is done by BackupPC_tarExtract as the backup proceeds). Otherwise, BackupPC_tarExtract writes the new file to disk and a new hard link is made in the pool to the file (this is done later by BackupPC_link).</p>
<p>Therefore, every file in the pool will have at least 2 hard links (one for the pool file and one for the backup file below /var/lib/backuppc/pc). Identical files from different backups or PCs will all be linked to the same file. When old backups are deleted, some files in the pool might only have one link. BackupPC_nightly checks the entire pool and removes all files that have only a single link, thereby recovering the storage for that file.</p>
<p>One other issue: zero length files are not pooled, since there are a lot of these files and on most file systems it doesn't save any disk space to turn these files into hard links.</p>
</dd>
<dt id="TOPDIR__-cpool">/var/lib/backuppc/cpool</dt>
<dd>
<p>All compressed files from PC backups are stored below /var/lib/backuppc/cpool. Its layout is the same as /var/lib/backuppc/pool, and the hashing function is the same (and, importantly, based on the uncompressed file, not the compressed file).</p>
</dd>
<dt id="TOPDIR__-pc-host">/var/lib/backuppc/pc/$host</dt>
<dd>
<p>For each PC $host, all the backups for that PC are stored below the directory /var/lib/backuppc/pc/$host. This directory contains the following files:</p>
<dl>
<dt id="LOG1">LOG</dt>
<dd>
<p>Current log file for this PC from BackupPC_dump.</p>
</dd>
<dt id="LOG.DDMMYYYY-or-LOG.DDMMYYYY.z">LOG.DDMMYYYY or LOG.DDMMYYYY.z</dt>
<dd>
<p>Last month's log file. Log files are aged monthly and compressed (if compression is enabled), and old LOG files are deleted. In earlier versions of BackupPC these files used to have a suffix of 0, 1, ....</p>
</dd>
<dt id="XferERR-or-XferERR.z">XferERR or XferERR.z</dt>
<dd>
<p>Output from the transport program (ie: smbclient, tar, rsync or ftp) for the most recent failed backup.</p>
</dd>
<dt id="new">new</dt>
<dd>
<p>Subdirectory in which the current backup is stored. This directory is renamed if the backup succeeds.</p>
</dd>
<dt id="XferLOG-or-XferLOG.z">XferLOG or XferLOG.z</dt>
<dd>
<p>Output from the transport program (ie: smbclient, tar, rsync or ftp) for the current backup.</p>
</dd>
<dt id="nnn-an-integer-">nnn (an integer)</dt>
<dd>
<p>Successful backups are in directories numbered sequentially starting at 0.</p>
</dd>
<dt id="XferLOG.nnn-or-XferLOG.nnn.z">XferLOG.nnn or XferLOG.nnn.z</dt>
<dd>
<p>Output from the transport program (ie: smbclient, tar, rsync or ftp) corresponding to backup number nnn.</p>
</dd>
<dt id="RestoreInfo.nnn">RestoreInfo.nnn</dt>
<dd>
<p>Information about restore request #nnn including who, what, when, and why. This file is in Data::Dumper format. (Note that the restore numbers are not related to the backup number.)</p>
</dd>
<dt id="RestoreLOG.nnn.z">RestoreLOG.nnn.z</dt>
<dd>
<p>Output from smbclient, tar or rsync during restore #nnn. (Note that the restore numbers are not related to the backup number.)</p>
</dd>
<dt id="ArchiveInfo.nnn">ArchiveInfo.nnn</dt>
<dd>
<p>Information about archive request #nnn including who, what, when, and why. This file is in Data::Dumper format. (Note that the archive numbers are not related to the restore or backup number.)</p>
</dd>
<dt id="ArchiveLOG.nnn.z">ArchiveLOG.nnn.z</dt>
<dd>
<p>Output from archive #nnn. (Note that the archive numbers are not related to the backup or restore number.)</p>
</dd>
<dt id="config.pl1">config.pl</dt>
<dd>
<p>Old location of optional configuration settings specific to this host. Settings in this file override the main configuration file. In new versions of BackupPC the per-host configuration files are stored in /etc/backuppc/pc/HOST.pl.</p>
</dd>
<dt id="backups">backups</dt>
<dd>
<p>A tab-delimited ascii table listing information about each successful backup, one per row. The columns are:</p>
<dl>
<dt id="num">num</dt>
<dd>
<p>The backup number, an integer that starts at 0 and increments for each successive backup. The corresponding backup is stored in the directory num (eg: if this field is 5, then the backup is stored in /var/lib/backuppc/pc/$host/5).</p>
</dd>
<dt id="type">type</dt>
<dd>
<p>Set to "full" or "incr" for full or incremental backup.</p>
</dd>
<dt id="startTime">startTime</dt>
<dd>
<p>Start time of the backup in unix seconds.</p>
</dd>
<dt id="endTime">endTime</dt>
<dd>
<p>Stop time of the backup in unix seconds.</p>
</dd>
<dt id="nFiles">nFiles</dt>
<dd>
<p>Number of files backed up (as reported by smbclient, tar, rsync or ftp).</p>
</dd>
<dt id="size">size</dt>
<dd>
<p>Total file size backed up (as reported by smbclient, tar, rsync or ftp).</p>
</dd>
<dt id="nFilesExist">nFilesExist</dt>
<dd>
<p>Number of files that were already in the pool (as determined by BackupPC_dump and BackupPC_link).</p>
</dd>
<dt id="sizeExist">sizeExist</dt>
<dd>
<p>Total size of files that were already in the pool (as determined by BackupPC_dump and BackupPC_link).</p>
</dd>
<dt id="nFilesNew">nFilesNew</dt>
<dd>
<p>Number of files that were not in the pool (as determined by BackupPC_link).</p>
</dd>
<dt id="sizeNew">sizeNew</dt>
<dd>
<p>Total size of files that were not in the pool (as determined by BackupPC_link).</p>
</dd>
<dt id="xferErrs">xferErrs</dt>
<dd>
<p>Number of errors or warnings from smbclient, tar, rsync or ftp.</p>
</dd>
<dt id="xferBadFile">xferBadFile</dt>
<dd>
<p>Number of errors from smbclient that were bad file errors (zero otherwise).</p>
</dd>
<dt id="xferBadShare">xferBadShare</dt>
<dd>
<p>Number of errors from smbclient that were bad share errors (zero otherwise).</p>
</dd>
<dt id="tarErrs">tarErrs</dt>
<dd>
<p>Number of errors from BackupPC_tarExtract.</p>
</dd>
<dt id="compress">compress</dt>
<dd>
<p>The compression level used on this backup. Zero or empty means no compression.</p>
</dd>
<dt id="sizeExistComp">sizeExistComp</dt>
<dd>
<p>Total compressed size of files that were already in the pool (as determined by BackupPC_dump and BackupPC_link).</p>
</dd>
<dt id="sizeNewComp">sizeNewComp</dt>
<dd>
<p>Total compressed size of files that were not in the pool (as determined by BackupPC_link).</p>
</dd>
<dt id="noFill">noFill</dt>
<dd>
<p>Set if this backup has not been filled in with the most recent previous filled or full backup. See <a href="#_conf_incrfill_">$Conf{IncrFill}</a>.</p>
</dd>
<dt id="fillFromNum">fillFromNum</dt>
<dd>
<p>If this backup was filled (ie: noFill is 0) then this is the number of the backup that it was filled from</p>
</dd>
<dt id="mangle">mangle</dt>
<dd>
<p>Set if this backup has mangled file names and attributes. Always true for backups in v1.4.0 and above. False for all backups prior to v1.4.0.</p>
</dd>
<dt id="xferMethod">xferMethod</dt>
<dd>
<p>Set to the value of <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> when this dump was done.</p>
</dd>
<dt id="level">level</dt>
<dd>
<p>The level of this dump. A full dump is level 0. Currently incrementals are 1. But when multi-level incrementals are supported this will reflect each dump's incremental level.</p>
</dd>
</dl>
</dd>
<dt id="restores">restores</dt>
<dd>
<p>A tab-delimited ascii table listing information about each requested restore, one per row. The columns are:</p>
<dl>
<dt id="num1">num</dt>
<dd>
<p>Restore number (matches the suffix of the RestoreInfo.nnn and RestoreLOG.nnn.z file), unrelated to the backup number.</p>
</dd>
<dt id="startTime1">startTime</dt>
<dd>
<p>Start time of the restore in unix seconds.</p>
</dd>
<dt id="endTime1">endTime</dt>
<dd>
<p>End time of the restore in unix seconds.</p>
</dd>
<dt id="result">result</dt>
<dd>
<p>Result (ok or failed).</p>
</dd>
<dt id="errorMsg">errorMsg</dt>
<dd>
<p>Error message if restore failed.</p>
</dd>
<dt id="nFiles1">nFiles</dt>
<dd>
<p>Number of files restored.</p>
</dd>
<dt id="size1">size</dt>
<dd>
<p>Size in bytes of the restored files.</p>
</dd>
<dt id="tarCreateErrs">tarCreateErrs</dt>
<dd>
<p>Number of errors from BackupPC_tarCreate during restore.</p>
</dd>
<dt id="xferErrs1">xferErrs</dt>
<dd>
<p>Number of errors from smbclient, tar, rsync or ftp during restore.</p>
</dd>
</dl>
</dd>
<dt id="archives">archives</dt>
<dd>
<p>A tab-delimited ascii table listing information about each requested archive, one per row. The columns are:</p>
<dl>
<dt id="num2">num</dt>
<dd>
<p>Archive number (matches the suffix of the ArchiveInfo.nnn and ArchiveLOG.nnn.z file), unrelated to the backup or restore number.</p>
</dd>
<dt id="startTime2">startTime</dt>
<dd>
<p>Start time of the restore in unix seconds.</p>
</dd>
<dt id="endTime2">endTime</dt>
<dd>
<p>End time of the restore in unix seconds.</p>
</dd>
<dt id="result1">result</dt>
<dd>
<p>Result (ok or failed).</p>
</dd>
<dt id="errorMsg1">errorMsg</dt>
<dd>
<p>Error message if archive failed.</p>
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
<h2 id="Compressed-file-format">Compressed file format</h2>
<p>The compressed file format is as generated by Compress::Zlib::deflate with one minor, but important, tweak. Since Compress::Zlib::inflate fully inflates its argument in memory, it could take large amounts of memory if it was inflating a highly compressed file. For example, a 200MB file of 0x0 bytes compresses to around 200K bytes. If Compress::Zlib::inflate was called with this single 200K buffer, it would need to allocate 200MB of memory to return the result.</p>
<p>BackupPC watches how efficiently a file is compressing. If a big file has very high compression (meaning it will use too much memory when it is inflated), BackupPC calls the flush() method, which gracefully completes the current compression. BackupPC then starts another deflate and simply appends the output file. So the BackupPC compressed file format is one or more concatenated deflations/flushes. The specific ratios that BackupPC uses is that if a 6MB chunk compresses to less than 64K then a flush will be done.</p>
<p>Back to the example of the 200MB file of 0x0 bytes. Adding flushes every 6MB adds only 200 or so bytes to the 200K output. So the storage cost of flushing is negligible.</p>
<p>To easily decompress a BackupPC compressed file, the script BackupPC_zcat can be found in /usr/share/backuppc/bin. For each file name argument it inflates the file and writes it to stdout.</p>
<h2 id="Rsync-checksum-caching">Rsync checksum caching</h2>
<p>An incremental backup with rsync compares attributes on the client with the last full backup. Any files with identical attributes are skipped. A full backup with rsync sets the --ignore-times option, which causes every file to be examined independent of attributes.</p>
<p>Each file is examined by generating block checksums (default 2K blocks) on the receiving side (that's the BackupPC side), sending those checksums to the client, where the remote rsync matches those checksums with the corresponding file. The matching blocks and new data is sent back, allowing the client file to be reassembled. A checksum for the entire file is sent to as an extra check the the reconstructed file is correct.</p>
<p>This results in significant disk IO and computation for BackupPC: every file in a full backup, or any file with non-matching attributes in an incremental backup, needs to be uncompressed, block checksums computed and sent. Then the receiving side reassembles the file and has to verify the whole-file checksum. Even if the file is identical, prior to 2.1.0, BackupPC had to read and uncompress the file twice, once to compute the block checksums and later to verify the whole-file checksum.</p>
<p>Starting in 2.1.0, BackupPC supports optional checksum caching, which means the block and file checksums only need to be computed once for each file. This results in a significant performance improvement. This only works for compressed pool files. It is enabled by adding</p>
<pre><code> '--checksum-seed=32761',</code></pre>
<p>to <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a> and <a href="#_conf_rsyncrestoreargs_">$Conf{RsyncRestoreArgs}</a>.</p>
<p>Rsync versions prior to and including rsync-2.6.2 need a small patch to add support for the --checksum-seed option. This patch is available in the cygwin-rsyncd package at <a href="http://backuppc.sourceforge.net">http://backuppc.sourceforge.net</a>. This patch is already included in rsync CVS, so it will be standard in future versions of rsync.</p>
<p>When this option is present, BackupPC will add block and file checksums to the compressed pool file the next time a pool file is used and it doesn't already have cached checksums. The first time a new file is written to the pool, the checksums are not appended. The next time checksums are needed for a file, they are computed and added. So the full performance benefit of checksum caching won't be noticed until the third time a pool file is used (eg: the third full backup).</p>
<p>With checksum caching enabled, there is a risk that should a file's contents in the pool be corrupted due to a disk problem, but the cached checksums are still correct, the corruption will not be detected by a full backup, since the file contents are no longer read and compared. To reduce the chance that this remains undetected, BackupPC can recheck cached checksums for a fraction of the files. This fraction is set with the <a href="#_conf_rsynccsumcacheverifyprob_">$Conf{RsyncCsumCacheVerifyProb}</a> setting. The default value of 0.01 means that 1% of the time a file's checksums are read, the checksums are verified. This reduces performance slightly, but, over time, ensures that files contents are in sync with the cached checksums.</p>
<p>The format of the cached checksum data can be discovered by looking at the code. Basically, the first byte of the compressed file is changed to denote that checksums are appended. The block and file checksum data, plus some other information and magic word, are appended to the compressed file. This allows the cache update to be done in-place.</p>
<h2 id="File-name-mangling">File name mangling</h2>
<p>Backup file names are stored in "mangled" form. Each node of a path is preceded by "f" (mnemonic: file), and special characters (\n, \r, % and /) are URI-encoded as "%xx", where xx is the ascii character's hex value. So c:/craig/example.txt is now stored as fc/fcraig/fexample.txt.</p>
<p>This was done mainly so meta-data could be stored alongside the backup files without name collisions. In particular, the attributes for the files in a directory are stored in a file called "attrib", and mangling avoids file name collisions (I discarded the idea of having a duplicate directory tree for every backup just to store the attributes). Other meta-data (eg: rsync checksums) could be stored in file names preceded by, eg, "c". There are two other benefits to mangling: the share name might contain "/" (eg: "/home/craig" for tar transport), and I wanted that represented as a single level in the storage tree. Secondly, as files are written to NewFileList for later processing by BackupPC_link, embedded newlines in the file's path will cause problems which are avoided by mangling.</p>
<p>The CGI script undoes the mangling, so it is invisible to the user. Old (unmangled) backups are still supported by the CGI interface.</p>
<h2 id="Special-files">Special files</h2>
<p>Linux/unix file systems support several special file types: symbolic links, character and block device files, fifos (pipes) and unix-domain sockets. All except unix-domain sockets are supported by BackupPC (there's no point in backing up or restoring unix-domain sockets since they only have meaning after a process creates them). Symbolic links are stored as a plain file whose contents are the contents of the link (not the file it points to). This file is compressed and pooled like any normal file. Character and block device files are also stored as plain files, whose contents are two integers separated by a comma; the numbers are the major and minor device number. These files are compressed and pooled like any normal file. Fifo files are stored as empty plain files (which are not pooled since they have zero size). In all cases, the original file type is stored in the attrib file so it can be correctly restored.</p>
<p>Hardlinks are also supported. When GNU tar first encounters a file with more than one link (ie: hardlinks) it dumps it as a regular file. When it sees the second and subsequent hardlinks to the same file, it dumps just the hardlink information. BackupPC correctly recognizes these hardlinks and stores them just like symlinks: a regular text file whose contents is the path of the file linked to. The CGI script will download the original file when you click on a hardlink.</p>
<p>Also, BackupPC_tarCreate has enough magic to re-create the hardlinks dynamically based on whether or not the original file and hardlinks are both included in the tar file. For example, imagine a/b/x is a hardlink to a/c/y. If you use BackupPC_tarCreate to restore directory a, then the tar file will include a/b/x as the original file and a/c/y will be a hardlink to a/b/x. If, instead you restore a/c, then the tar file will include a/c/y as the original file, not a hardlink.</p>
<h2 id="Attribute-file-format">Attribute file format</h2>
<p>The unix attributes for the contents of a directory (all the files and directories in that directory) are stored in a file called attrib. There is a single attrib file for each directory in a backup. For example, if c:/craig contains a single file c:/craig/example.txt, that file would be stored as fc/fcraig/fexample.txt and there would be an attribute file in fc/fcraig/attrib (and also fc/attrib and ./attrib). The file fc/fcraig/attrib would contain a single entry containing the attributes for fc/fcraig/fexample.txt.</p>
<p>The attrib file starts with a magic number, followed by the concatenation of the following information for each file:</p>
<ul>
<li><p>File name length in perl's pack "w" format (variable length base 128).</p>
</li>
<li><p>File name.</p>
</li>
<li><p>The unix file type, mode, uid, gid and file size divided by 4GB and file size modulo 4GB (type mode uid gid sizeDiv4GB sizeMod4GB), in perl's pack "w" format (variable length base 128).</p>
</li>
<li><p>The unix mtime (unix seconds) in perl's pack "N" format (32 bit integer).</p>
</li>
</ul>
<p>The attrib file is also compressed if compression is enabled. See the lib/BackupPC/Attrib.pm module for full details.</p>
<p>Attribute files are pooled just like normal backup files. This saves space if all the files in a directory have the same attributes across multiple backups, which is common.</p>
<h2 id="Optimizations">Optimizations</h2>
<p>BackupPC doesn't care about the access time of files in the pool since it saves attribute meta-data separate from the files. Since BackupPC mostly does reads from disk, maintaining the access time of files generates a lot of unnecessary disk writes. So, provided BackupPC has a dedicated data disk, you should consider mounting BackupPC's data directory with the noatime (or, with Linux kernels >=2.6.20, relatime) attribute (see mount(1)).</p>
<h2 id="Some-Limitations">Some Limitations</h2>
<p>BackupPC isn't perfect (but it is getting better). Please see <a href="http://backuppc.sourceforge.net/faq/limitations.html">http://backuppc.sourceforge.net/faq/limitations.html</a> for a discussion of some of BackupPC's limitations.</p>
<h2 id="Security-issues">Security issues</h2>
<p>Please see <a href="http://backuppc.sourceforge.net/faq/security.html">http://backuppc.sourceforge.net/faq/security.html</a> for a discussion of some of various security issues.</p>
<hr />
<h1 id="Configuration-File">Configuration File</h1>
<p>The BackupPC configuration file resides in /etc/backuppc/config.pl. Optional per-PC configuration files reside in /etc/backuppc/pc/$host.pl (or /var/lib/backuppc/pc/$host/config.pl in non-FHS versions of BackupPC). This file can be used to override settings just for a particular PC.</p>
<h2 id="Modifying-the-main-configuration-file">Modifying the main configuration file</h2>
<p>The configuration file is a perl script that is executed by BackupPC, so you should be careful to preserve the file syntax (punctuation, quotes etc) when you edit it. It is recommended that you use CVS, RCS or some other method of source control for changing config.pl.</p>
<p>BackupPC reads or re-reads the main configuration file and the hosts file in three cases:</p>
<ul>
<li><p>Upon startup.</p>
</li>
<li><p>When BackupPC is sent a HUP (-1) signal. Assuming you installed the init.d script, you can also do this with "/etc/init.d/backuppc reload".</p>
</li>
<li><p>When the modification time of config.pl file changes. BackupPC checks the modification time once during each regular wakeup.</p>
</li>
</ul>
<p>Whenever you change the configuration file you can either do a kill -HUP BackupPC_pid or simply wait until the next regular wakeup period.</p>
<p>Each time the configuration file is re-read a message is reported in the LOG file, so you can tail it (or view it via the CGI interface) to make sure your kill -HUP worked. Errors in parsing the configuration file are also reported in the LOG file.</p>
<p>The optional per-PC configuration file (/etc/backuppc/pc/$host.pl or /var/lib/backuppc/pc/$host/config.pl in non-FHS versions of BackupPC) is read whenever it is needed by BackupPC_dump, BackupPC_link and others.</p>
<hr />
<h1 id="Configuration-Parameters">Configuration Parameters</h1>
<p>The configuration parameters are divided into five general groups. The first group (general server configuration) provides general configuration for BackupPC. The next two groups describe what to backup, when to do it, and how long to keep it. The fourth group are settings for email reminders, and the final group contains settings for the CGI interface.</p>
<p>All configuration settings in the second through fifth groups can be overridden by the per-PC config.pl file.</p>
<h2 id="General-server-configuration">General server configuration</h2>
<dl>
<strong><dt id="_conf_serverhost_">$Conf{ServerHost}</a> = '';</dt></strong>
<dd>
<p>Host name on which the BackupPC server is running.</p>
</dd>
<strong><dt id="_conf_serverport_">$Conf{ServerPort}</a> = -1;</dt></strong>
<dd>
<p>TCP port number on which the BackupPC server listens for and accepts connections. Normally this should be disabled (set to -1). The TCP port is only needed if apache runs on a different machine from BackupPC. In that case, set this to any spare port number over 1024 (eg: 2359). If you enable the TCP port, make sure you set <a href="#_conf_servermesgsecret_">$Conf{ServerMesgSecret}</a> too!</p>
</dd>
<strong><dt id="_conf_servermesgsecret_">$Conf{ServerMesgSecret}</a> = '';</dt></strong>
<dd>
<p>Shared secret to make the TCP port secure. Set this to a hard to guess string if you enable the TCP port (ie: <a href="#_conf_serverport_">$Conf{ServerPort}</a> > 0).</p>
<p>To avoid possible attacks via the TCP socket interface, every client message is protected by an MD5 digest. The MD5 digest includes four items: - a seed that is sent to the client when the connection opens - a sequence number that increments for each message - a shared secret that is stored in <a href="#_conf_servermesgsecret_">$Conf{ServerMesgSecret}</a> - the message itself.</p>
<p>The message is sent in plain text preceded by the MD5 digest. A snooper can see the plain-text seed sent by BackupPC and plain-text message from the client, but cannot construct a valid MD5 digest since the secret <a href="#_conf_servermesgsecret_">$Conf{ServerMesgSecret}</a> is unknown. A replay attack is not possible since the seed changes on a per-connection and per-message basis.</p>
</dd>
<strong><dt id="_conf_mypath_">$Conf{MyPath}</a> = '/bin';</dt></strong>
<dd>
<p>PATH setting for BackupPC. An explicit value is necessary for taint mode. Value shouldn't matter too much since all execs use explicit paths. However, taint mode in perl will complain if this directory is world writable.</p>
</dd>
<strong><dt id="_conf_umaskmode_">$Conf{UmaskMode}</a> = 027;</dt></strong>
<dd>
<p>Permission mask for directories and files created by BackupPC. Default value prevents any access from group other, and prevents group write.</p>
</dd>
<strong><dt id="_conf_wakeupschedule_">$Conf{WakeupSchedule}</a> = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];</dt></strong>
<dd>
<p>Times at which we wake up, check all the PCs, and schedule necessary backups. Times are measured in hours since midnight. Can be fractional if necessary (eg: 4.25 means 4:15am).</p>
<p>If the hosts you are backing up are always connected to the network you might have only one or two wakeups each night. This will keep the backup activity after hours. On the other hand, if you are backing up laptops that are only intermittently connected to the network you will want to have frequent wakeups (eg: hourly) to maximize the chance that each laptop is backed up.</p>
<p>Examples:</p>
<pre><code> <a href="#_conf_wakeupschedule_">$Conf{WakeupSchedule}</a> = [22.5]; # once per day at 10:30 pm.
<a href="#_conf_wakeupschedule_">$Conf{WakeupSchedule}</a> = [2,4,6,8,10,12,14,16,18,20,22]; # every 2 hours</code></pre>
<p>The default value is every hour except midnight.</p>
<p>The first entry of <a href="#_conf_wakeupschedule_">$Conf{WakeupSchedule}</a> is when BackupPC_nightly is run. You might want to re-arrange the entries in <a href="#_conf_wakeupschedule_">$Conf{WakeupSchedule}</a> (they don't have to be ascending) so that the first entry is when you want BackupPC_nightly to run (eg: when you don't expect a lot of regular backups to run).</p>
</dd>
<strong><dt id="_conf_maxbackups_">$Conf{MaxBackups}</a> = 4;</dt></strong>
<dd>
<p>Maximum number of simultaneous backups to run. If there are no user backup requests then this is the maximum number of simultaneous backups.</p>
</dd>
<strong><dt id="_conf_maxuserbackups_">$Conf{MaxUserBackups}</a> = 4;</dt></strong>
<dd>
<p>Additional number of simultaneous backups that users can run. As many as <a href="#_conf_maxbackups_">$Conf{MaxBackups}</a> + <a href="#_conf_maxuserbackups_">$Conf{MaxUserBackups}</a> requests can run at the same time.</p>
</dd>
<strong><dt id="_conf_maxpendingcmds_">$Conf{MaxPendingCmds}</a> = 15;</dt></strong>
<dd>
<p>Maximum number of pending link commands. New backups will only be started if there are no more than <a href="#_conf_maxpendingcmds_">$Conf{MaxPendingCmds}</a> plus <a href="#_conf_maxbackups_">$Conf{MaxBackups}</a> number of pending link commands, plus running jobs. This limit is to make sure BackupPC doesn't fall too far behind in running BackupPC_link commands.</p>
</dd>
<strong><dt id="_conf_cmdqueuenice_">$Conf{CmdQueueNice}</a> = 10;</dt></strong>
<dd>
<p>Nice level at which CmdQueue commands (eg: BackupPC_link and BackupPC_nightly) are run at.</p>
</dd>
<strong><dt id="_conf_maxbackuppcnightlyjobs_">$Conf{MaxBackupPCNightlyJobs}</a> = 2;</dt></strong>
<dd>
<p>How many BackupPC_nightly processes to run in parallel.</p>
<p>Each night, at the first wakeup listed in <a href="#_conf_wakeupschedule_">$Conf{WakeupSchedule}</a>, BackupPC_nightly is run. Its job is to remove unneeded files in the pool, ie: files that only have one link. To avoid race conditions, BackupPC_nightly and BackupPC_link cannot run at the same time. Starting in v3.0.0, BackupPC_nightly can run concurrently with backups (BackupPC_dump).</p>
<p>So to reduce the elapsed time, you might want to increase this setting to run several BackupPC_nightly processes in parallel (eg: 4, or even 8).</p>
</dd>
<strong><dt id="_conf_backuppcnightlyperiod_">$Conf{BackupPCNightlyPeriod}</a> = 1;</dt></strong>
<dd>
<p>How many days (runs) it takes BackupPC_nightly to traverse the entire pool. Normally this is 1, which means every night it runs, it does traverse the entire pool removing unused pool files.</p>
<p>Other valid values are 2, 4, 8, 16. This causes BackupPC_nightly to traverse 1/2, 1/4, 1/8 or 1/16th of the pool each night, meaning it takes 2, 4, 8 or 16 days to completely traverse the pool. The advantage is that each night the running time of BackupPC_nightly is reduced roughly in proportion, since the total job is split over multiple days. The disadvantage is that unused pool files take longer to get deleted, which will slightly increase disk usage.</p>
<p>Note that even when <a href="#_conf_backuppcnightlyperiod_">$Conf{BackupPCNightlyPeriod}</a> > 1, BackupPC_nightly still runs every night. It just does less work each time it runs.</p>
<p>Examples:</p>
<pre><code> <a href="#_conf_backuppcnightlyperiod_">$Conf{BackupPCNightlyPeriod}</a> = 1; # entire pool is checked every night
<a href="#_conf_backuppcnightlyperiod_">$Conf{BackupPCNightlyPeriod}</a> = 2; # two days to complete pool check
# (different half each night)
<a href="#_conf_backuppcnightlyperiod_">$Conf{BackupPCNightlyPeriod}</a> = 4; # four days to complete pool check
# (different quarter each night)</code></pre>
</dd>
<strong><dt id="_conf_maxoldlogfiles_">$Conf{MaxOldLogFiles}</a> = 14;</dt></strong>
<dd>
<p>Maximum number of log files we keep around in log directory. These files are aged nightly. A setting of 14 means the log directory will contain about 2 weeks of old log files, in particular at most the files LOG, LOG.0, LOG.1, ... LOG.13 (except today's LOG, these files will have a .z extension if compression is on).</p>
<p>If you decrease this number after BackupPC has been running for a while you will have to manually remove the older log files.</p>
</dd>
<strong><dt id="_conf_dfpath_">$Conf{DfPath}</a> = '';</dt></strong>
<dd>
<p>Full path to the df command. Security caution: normal users should not allowed to write to this file or directory.</p>
</dd>
<strong><dt id="_conf_dfcmd_">$Conf{DfCmd}</a> = '$dfPath $topDir';</dt></strong>
<dd>
<p>Command to run df. The following variables are substituted at run-time:</p>
<pre><code> $dfPath path to df (<a href="#_conf_dfpath_">$Conf{DfPath}</a>)
$topDir top-level BackupPC data directory</code></pre>
<p>Note: all Cmds are executed directly without a shell, so the prog name needs to be a full path and you can't include shell syntax like redirection and pipes; put that in a script if you need it.</p>
</dd>
<strong><dt id="_conf_splitpath_">$Conf{SplitPath}</a> = '';</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_parpath_">$Conf{ParPath}</a> = '';</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_catpath_">$Conf{CatPath}</a> = '';</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_gzippath_">$Conf{GzipPath}</a> = '';</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_bzip2path_">$Conf{Bzip2Path}</a> = '';</dt></strong>
<dd>
<p>Full path to various commands for archiving</p>
</dd>
<strong><dt id="_conf_dfmaxusagepct_">$Conf{DfMaxUsagePct}</a> = 95;</dt></strong>
<dd>
<p>Maximum threshold for disk utilization on the /var/lib/backuppc filesystem. If the output from <a href="#_conf_dfpath_">$Conf{DfPath}</a> reports a percentage larger than this number then no new regularly scheduled backups will be run. However, user requested backups (which are usually incremental and tend to be small) are still performed, independent of disk usage. Also, currently running backups will not be terminated when the disk usage exceeds this number.</p>
</dd>
<strong><dt id="_conf_trashcleansleepsec_">$Conf{TrashCleanSleepSec}</a> = 300;</dt></strong>
<dd>
<p>How long BackupPC_trashClean sleeps in seconds between each check of the trash directory. Once every 5 minutes should be reasonable.</p>
</dd>
<strong><dt id="_conf_dhcpaddressranges_">$Conf{DHCPAddressRanges}</a> = [];</dt></strong>
<dd>
<p>List of DHCP address ranges we search looking for PCs to backup. This is an array of hashes for each class C address range. This is only needed if hosts in the conf/hosts file have the dhcp flag set.</p>
<p>Examples:</p>
<pre><code> # to specify 192.10.10.20 to 192.10.10.250 as the DHCP address pool
<a href="#_conf_dhcpaddressranges_">$Conf{DHCPAddressRanges}</a> = [
{
ipAddrBase => '192.10.10',
first => 20,
last => 250,
},
];
# to specify two pools (192.10.10.20-250 and 192.10.11.10-50)
<a href="#_conf_dhcpaddressranges_">$Conf{DHCPAddressRanges}</a> = [
{
ipAddrBase => '192.10.10',
first => 20,
last => 250,
},
{
ipAddrBase => '192.10.11',
first => 10,
last => 50,
},
];</code></pre>
</dd>
<strong><dt id="_conf_backuppcuser_">$Conf{BackupPCUser}</a> = '';</dt></strong>
<dd>
<p>The BackupPC user.</p>
</dd>
<strong><dt id="_conf_topdir_">$Conf{TopDir}</a> = '';</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_confdir_">$Conf{ConfDir}</a> = '';</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_logdir_">$Conf{LogDir}</a> = '';</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_installdir_">$Conf{InstallDir}</a> = '';</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_cgidir_">$Conf{CgiDir}</a> = '';</dt></strong>
<dd>
<p>Important installation directories:</p>
<pre><code> TopDir - where all the backup data is stored
ConfDir - where the main config and hosts files resides
LogDir - where log files and other transient information
InstallDir - where the bin, lib and doc installation dirs reside.
Note: you cannot change this value since all the
perl scripts include this path. You must reinstall
with configure.pl to change InstallDir.
CgiDir - Apache CGI directory for BackupPC_Admin</code></pre>
<p>Note: it is STRONGLY recommended that you don't change the values here. These are set at installation time and are here for reference and are used during upgrades.</p>
<p>Instead of changing TopDir here it is recommended that you use a symbolic link to the new location, or mount the new BackupPC store at the existing <a href="#_conf_topdir_">$Conf{TopDir}</a> setting.</p>
</dd>
<strong><dt id="_conf_backuppcuserverify_">$Conf{BackupPCUserVerify}</a> = 1;</dt></strong>
<dd>
<p>Whether BackupPC and the CGI script BackupPC_Admin verify that they are really running as user <a href="#_conf_backuppcuser_">$Conf{BackupPCUser}</a>. If this flag is set and the effective user id (euid) differs from <a href="#_conf_backuppcuser_">$Conf{BackupPCUser}</a> then both scripts exit with an error. This catches cases where BackupPC might be accidently started as root or the wrong user, or if the CGI script is not installed correctly.</p>
</dd>
<strong><dt id="_conf_hardlinkmax_">$Conf{HardLinkMax}</a> = 31999;</dt></strong>
<dd>
<p>Maximum number of hardlinks supported by the $TopDir file system that BackupPC uses. Most linux or unix file systems should support at least 32000 hardlinks per file, or 64000 in other cases. If a pool file already has this number of hardlinks, a new pool file is created so that new hardlinks can be accommodated. This limit will only be hit if an identical file appears at least this number of times across all the backups.</p>
</dd>
<strong><dt id="_conf_perlmoduleload_">$Conf{PerlModuleLoad}</a> = undef;</dt></strong>
<dd>
<p>Advanced option for asking BackupPC to load additional perl modules. Can be a list (array ref) of module names to load at startup.</p>
</dd>
<strong><dt id="_conf_serverinitdpath_">$Conf{ServerInitdPath}</a> = '';</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_serverinitdstartcmd_">$Conf{ServerInitdStartCmd}</a> = '';</dt></strong>
<dd>
<p>Path to init.d script and command to use that script to start the server from the CGI interface. The following variables are substituted at run-time:</p>
<pre><code> $sshPath path to ssh (<a href="#_conf_sshpath_">$Conf{SshPath}</a>)
$serverHost same as <a href="#_conf_serverhost_">$Conf{ServerHost}</a>
$serverInitdPath path to init.d script (<a href="#_conf_serverinitdpath_">$Conf{ServerInitdPath}</a>)</code></pre>
<p>Example:</p>
<p><a href="#_conf_serverinitdpath_">$Conf{ServerInitdPath}</a> = '/etc/init.d/backuppc'; <a href="#_conf_serverinitdstartcmd_">$Conf{ServerInitdStartCmd}</a> = '$sshPath -q -x -l root $serverHost' . ' $serverInitdPath start' . ' < /dev/null >& /dev/null';</p>
<p>Note: all Cmds are executed directly without a shell, so the prog name needs to be a full path and you can't include shell syntax like redirection and pipes; put that in a script if you need it.</p>
</dd>
</dl>
<h2 id="What-to-backup-and-when-to-do-it">What to backup and when to do it</h2>
<dl>
<strong><dt id="_conf_fullperiod_">$Conf{FullPeriod}</a> = 6.97;</dt></strong>
<dd>
<p>Minimum period in days between full backups. A full dump will only be done if at least this much time has elapsed since the last full dump, and at least <a href="#_conf_incrperiod_">$Conf{IncrPeriod}</a> days has elapsed since the last successful dump.</p>
<p>Typically this is set slightly less than an integer number of days. The time taken for the backup, plus the granularity of <a href="#_conf_wakeupschedule_">$Conf{WakeupSchedule}</a> will make the actual backup interval a bit longer.</p>
</dd>
<strong><dt id="_conf_incrperiod_">$Conf{IncrPeriod}</a> = 0.97;</dt></strong>
<dd>
<p>Minimum period in days between incremental backups (a user requested incremental backup will be done anytime on demand).</p>
<p>Typically this is set slightly less than an integer number of days. The time taken for the backup, plus the granularity of <a href="#_conf_wakeupschedule_">$Conf{WakeupSchedule}</a> will make the actual backup interval a bit longer.</p>
</dd>
<strong><dt id="_conf_fullkeepcnt_">$Conf{FullKeepCnt}</a> = 1;</dt></strong>
<dd>
<p>Number of full backups to keep. Must be >= 1.</p>
<p>In the steady state, each time a full backup completes successfully the oldest one is removed. If this number is decreased, the extra old backups will be removed.</p>
<p>If filling of incremental dumps is off the oldest backup always has to be a full (ie: filled) dump. This might mean one or two extra full dumps are kept until the oldest incremental backups expire.</p>
<p>Exponential backup expiry is also supported. This allows you to specify:</p>
<pre><code> - num fulls to keep at intervals of 1 * <a href="#_conf_fullperiod_">$Conf{FullPeriod}</a>, followed by
- num fulls to keep at intervals of 2 * <a href="#_conf_fullperiod_">$Conf{FullPeriod}</a>,
- num fulls to keep at intervals of 4 * <a href="#_conf_fullperiod_">$Conf{FullPeriod}</a>,
- num fulls to keep at intervals of 8 * <a href="#_conf_fullperiod_">$Conf{FullPeriod}</a>,
- num fulls to keep at intervals of 16 * <a href="#_conf_fullperiod_">$Conf{FullPeriod}</a>,</code></pre>
<p>and so on. This works by deleting every other full as each expiry boundary is crossed.</p>
<p>Exponential expiry is specified using an array for <a href="#_conf_fullkeepcnt_">$Conf{FullKeepCnt}</a>:</p>
<pre><code> <a href="#_conf_fullkeepcnt_">$Conf{FullKeepCnt}</a> = [4, 2, 3];</code></pre>
<p>Entry #n specifies how many fulls to keep at an interval of 2^n * <a href="#_conf_fullperiod_">$Conf{FullPeriod}</a> (ie: 1, 2, 4, 8, 16, 32, ...).</p>
<p>The example above specifies keeping 4 of the most recent full backups (1 week interval) two full backups at 2 week intervals, and 3 full backups at 4 week intervals, eg:</p>
<pre><code> full 0 19 weeks old \
full 1 15 weeks old >--- 3 backups at 4 * <a href="#_conf_fullperiod_">$Conf{FullPeriod}</a>
full 2 11 weeks old /
full 3 7 weeks old \____ 2 backups at 2 * <a href="#_conf_fullperiod_">$Conf{FullPeriod}</a>
full 4 5 weeks old /
full 5 3 weeks old \
full 6 2 weeks old \___ 4 backups at 1 * <a href="#_conf_fullperiod_">$Conf{FullPeriod}</a>
full 7 1 week old /
full 8 current /</code></pre>
<p>On a given week the spacing might be less than shown as each backup ages through each expiry period. For example, one week later, a new full is completed and the oldest is deleted, giving:</p>
<pre><code> full 0 16 weeks old \
full 1 12 weeks old >--- 3 backups at 4 * <a href="#_conf_fullperiod_">$Conf{FullPeriod}</a>
full 2 8 weeks old /
full 3 6 weeks old \____ 2 backups at 2 * <a href="#_conf_fullperiod_">$Conf{FullPeriod}</a>
full 4 4 weeks old /
full 5 3 weeks old \
full 6 2 weeks old \___ 4 backups at 1 * <a href="#_conf_fullperiod_">$Conf{FullPeriod}</a>
full 7 1 week old /
full 8 current /</code></pre>
<p>You can specify 0 as a count (except in the first entry), and the array can be as long as you wish. For example:</p>
<pre><code> <a href="#_conf_fullkeepcnt_">$Conf{FullKeepCnt}</a> = [4, 0, 4, 0, 0, 2];</code></pre>
<p>This will keep 10 full dumps, 4 most recent at 1 * <a href="#_conf_fullperiod_">$Conf{FullPeriod}</a>, followed by 4 at an interval of 4 * <a href="#_conf_fullperiod_">$Conf{FullPeriod}</a> (approx 1 month apart), and then 2 at an interval of 32 * <a href="#_conf_fullperiod_">$Conf{FullPeriod}</a> (approx 7-8 months apart).</p>
<p>Example: these two settings are equivalent and both keep just the four most recent full dumps:</p>
<pre><code> <a href="#_conf_fullkeepcnt_">$Conf{FullKeepCnt}</a> = 4;
<a href="#_conf_fullkeepcnt_">$Conf{FullKeepCnt}</a> = [4];</code></pre>
</dd>
<strong><dt id="_conf_fullkeepcntmin_">$Conf{FullKeepCntMin}</a> = 1;</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_fullagemax_">$Conf{FullAgeMax}</a> = 90;</dt></strong>
<dd>
<p>Very old full backups are removed after <a href="#_conf_fullagemax_">$Conf{FullAgeMax}</a> days. However, we keep at least <a href="#_conf_fullkeepcntmin_">$Conf{FullKeepCntMin}</a> full backups no matter how old they are.</p>
<p>Note that <a href="#_conf_fullagemax_">$Conf{FullAgeMax}</a> will be increased to <a href="#_conf_fullkeepcnt_">$Conf{FullKeepCnt}</a> times <a href="#_conf_fullperiod_">$Conf{FullPeriod}</a> if <a href="#_conf_fullkeepcnt_">$Conf{FullKeepCnt}</a> specifies enough full backups to exceed <a href="#_conf_fullagemax_">$Conf{FullAgeMax}</a>.</p>
</dd>
<strong><dt id="_conf_incrkeepcnt_">$Conf{IncrKeepCnt}</a> = 6;</dt></strong>
<dd>
<p>Number of incremental backups to keep. Must be >= 1.</p>
<p>In the steady state, each time an incr backup completes successfully the oldest one is removed. If this number is decreased, the extra old backups will be removed.</p>
</dd>
<strong><dt id="_conf_incrkeepcntmin_">$Conf{IncrKeepCntMin}</a> = 1;</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_incragemax_">$Conf{IncrAgeMax}</a> = 30;</dt></strong>
<dd>
<p>Very old incremental backups are removed after <a href="#_conf_incragemax_">$Conf{IncrAgeMax}</a> days. However, we keep at least <a href="#_conf_incrkeepcntmin_">$Conf{IncrKeepCntMin}</a> incremental backups no matter how old they are.</p>
</dd>
<strong><dt id="_conf_incrlevels_">$Conf{IncrLevels}</a> = [1];</dt></strong>
<dd>
<p>Level of each incremental. "Level" follows the terminology of dump(1). A full backup has level 0. A new incremental of level N will backup all files that have changed since the most recent backup of a lower level.</p>
<p>The entries of <a href="#_conf_incrlevels_">$Conf{IncrLevels}</a> apply in order to each incremental after each full backup. It wraps around until the next full backup. For example, these two settings have the same effect:</p>
<pre><code> <a href="#_conf_incrlevels_">$Conf{IncrLevels}</a> = [1, 2, 3];
<a href="#_conf_incrlevels_">$Conf{IncrLevels}</a> = [1, 2, 3, 1, 2, 3];</code></pre>
<p>This means the 1st and 4th incrementals (level 1) go all the way back to the full. The 2nd and 3rd (and 5th and 6th) backups just go back to the immediate preceeding incremental.</p>
<p>Specifying a sequence of multi-level incrementals will usually mean more than <a href="#_conf_incrkeepcnt_">$Conf{IncrKeepCnt}</a> incrementals will need to be kept, since lower level incrementals are needed to merge a complete view of a backup. For example, with</p>
<pre><code> <a href="#_conf_fullperiod_">$Conf{FullPeriod}</a> = 7;
<a href="#_conf_incrperiod_">$Conf{IncrPeriod}</a> = 1;
<a href="#_conf_incrkeepcnt_">$Conf{IncrKeepCnt}</a> = 6;
<a href="#_conf_incrlevels_">$Conf{IncrLevels}</a> = [1, 2, 3, 4, 5, 6];</code></pre>
<p>there will be up to 11 incrementals in this case:</p>
<pre><code> backup #0 (full, level 0, oldest)
backup #1 (incr, level 1)
backup #2 (incr, level 2)
backup #3 (incr, level 3)
backup #4 (incr, level 4)
backup #5 (incr, level 5)
backup #6 (incr, level 6)
backup #7 (full, level 0)
backup #8 (incr, level 1)
backup #9 (incr, level 2)
backup #10 (incr, level 3)
backup #11 (incr, level 4)
backup #12 (incr, level 5, newest)</code></pre>
<p>Backup #1 (the oldest level 1 incremental) can't be deleted since backups 2..6 depend on it. Those 6 incrementals can't all be deleted since that would only leave 5 (#8..12). When the next incremental happens (level 6), the complete set of 6 older incrementals (#1..6) will be deleted, since that maintains the required number (<a href="#_conf_incrkeepcnt_">$Conf{IncrKeepCnt}</a>) of incrementals. This situation is reduced if you set shorter chains of multi-level incrementals, eg:</p>
<pre><code> <a href="#_conf_incrlevels_">$Conf{IncrLevels}</a> = [1, 2, 3];</code></pre>
<p>would only have up to 2 extra incremenals before all 3 are deleted.</p>
<p>BackupPC as usual merges the full and the sequence of incrementals together so each incremental can be browsed and restored as though it is a complete backup. If you specify a long chain of incrementals then more backups need to be merged when browsing, restoring, or getting the starting point for rsync backups. In the example above (levels 1..6), browing backup #6 requires 7 different backups (#0..6) to be merged.</p>
<p>Because of this merging and the additional incrementals that need to be kept, it is recommended that some level 1 incrementals be included in <a href="#_conf_incrlevels_">$Conf{IncrLevels}</a>.</p>
<p>Prior to version 3.0 incrementals were always level 1, meaning each incremental backed up all the files that changed since the last full.</p>
</dd>
<strong><dt id="_conf_backupsdisable_">$Conf{BackupsDisable}</a> = 0;</dt></strong>
<dd>
<p>Disable all full and incremental backups. These settings are useful for a client that is no longer being backed up (eg: a retired machine), but you wish to keep the last backups available for browsing or restoring to other machines.</p>
<p>There are three values for <a href="#_conf_backupsdisable_">$Conf{BackupsDisable}</a>:</p>
<pre><code> 0 Backups are enabled.
1 Don't do any regular backups on this client. Manually
requested backups (via the CGI interface) will still occur.
2 Don't do any backups on this client. Manually requested
backups (via the CGI interface) will be ignored.</code></pre>
<p>In versions prior to 3.0 Backups were disabled by setting <a href="#_conf_fullperiod_">$Conf{FullPeriod}</a> to -1 or -2.</p>
</dd>
<strong><dt id="_conf_partialagemax_">$Conf{PartialAgeMax}</a> = 3;</dt></strong>
<dd>
<p>A failed full backup is saved as a partial backup. The rsync XferMethod can take advantage of the partial full when the next backup is run. This parameter sets the age of the partial full in days: if the partial backup is older than this number of days, then rsync will ignore (not use) the partial full when the next backup is run. If you set this to a negative value then no partials will be saved. If you set this to 0, partials will be saved, but will not be used by the next backup.</p>
<p>The default setting of 3 days means that a partial older than 3 days is ignored when the next full backup is done.</p>
</dd>
<strong><dt id="_conf_incrfill_">$Conf{IncrFill}</a> = 0;</dt></strong>
<dd>
<p>Whether incremental backups are filled. "Filling" means that the most recent full (or filled) dump is merged into the new incremental dump using hardlinks. This makes an incremental dump look like a full dump. Prior to v1.03 all incremental backups were filled. In v1.4.0 and later the default is off.</p>
<p>BackupPC, and the cgi interface in particular, do the right thing on un-filled incremental backups. It will correctly display the merged incremental backup with the most recent filled backup, giving the un-filled incremental backups a filled appearance. That means it invisible to the user whether incremental dumps are filled or not.</p>
<p>Filling backups takes a little extra disk space, and it does cost some extra disk activity for filling, and later removal. Filling is no longer useful, since file mangling and compression doesn't make a filled backup very useful. It's likely the filling option will be removed from future versions: filling will be delegated to the display and extraction of backup data.</p>
<p>If filling is off, BackupPC makes sure that the oldest backup is a full, otherwise the following incremental backups will be incomplete. This might mean an extra full backup has to be kept until the following incremental backups expire.</p>
<p>The default is off. You can turn this on or off at any time without affecting existing backups.</p>
</dd>
<strong><dt id="_conf_restoreinfokeepcnt_">$Conf{RestoreInfoKeepCnt}</a> = 10;</dt></strong>
<dd>
<p>Number of restore logs to keep. BackupPC remembers information about each restore request. This number per client will be kept around before the oldest ones are pruned.</p>
<p>Note: files/dirs delivered via Zip or Tar downloads don't count as restores. Only the first restore option (where the files and dirs are written to the host) count as restores that are logged.</p>
</dd>
<strong><dt id="_conf_archiveinfokeepcnt_">$Conf{ArchiveInfoKeepCnt}</a> = 10;</dt></strong>
<dd>
<p>Number of archive logs to keep. BackupPC remembers information about each archive request. This number per archive client will be kept around before the oldest ones are pruned.</p>
</dd>
<strong><dt id="_conf_backupfilesonly_">$Conf{BackupFilesOnly}</a> = undef;</dt></strong>
<dd>
<p>List of directories or files to backup. If this is defined, only these directories or files will be backed up.</p>
<p>When editing from the web interface, you should add a valid ShareName (based on <a href="#_conf_xfermethod_">$Conf{XferMethod}</a>), and then enter the directories specific to that ShareName. A special ShareName "*" matches any ShareName that doesn't have an explicit entry.</p>
<p>For Smb, only one of <a href="#_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a> and <a href="#_conf_backupfilesonly_">$Conf{BackupFilesOnly}</a> can be specified per share. If both are set for a particular share, then <a href="#_conf_backupfilesonly_">$Conf{BackupFilesOnly}</a> takes precedence and <a href="#_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a> is ignored.</p>
<p>This can be set to a string, an array of strings, or, in the case of multiple shares, a hash of strings or arrays. A hash is used to give a list of directories or files to backup for each share (the share name is the key). If this is set to just a string or array, and <a href="#_conf_smbsharename_">$Conf{SmbShareName}</a> contains multiple share names, then the setting is assumed to apply all shares.</p>
<p>If a hash is used, a special key "*" means it applies to all shares that don't have a specific entry.</p>
<p>Examples:</p>
<pre><code> <a href="#_conf_backupfilesonly_">$Conf{BackupFilesOnly}</a> = '/myFiles';
<a href="#_conf_backupfilesonly_">$Conf{BackupFilesOnly}</a> = ['/myFiles']; # same as first example
<a href="#_conf_backupfilesonly_">$Conf{BackupFilesOnly}</a> = ['/myFiles', '/important'];
<a href="#_conf_backupfilesonly_">$Conf{BackupFilesOnly}</a> = {
'c' => ['/myFiles', '/important'], # these are for 'c' share
'd' => ['/moreFiles', '/archive'], # these are for 'd' share
};
<a href="#_conf_backupfilesonly_">$Conf{BackupFilesOnly}</a> = {
'c' => ['/myFiles', '/important'], # these are for 'c' share
'*' => ['/myFiles', '/important'], # these are other shares
};</code></pre>
</dd>
<strong><dt id="_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a> = undef;</dt></strong>
<dd>
<p>List of directories or files to exclude from the backup. For Smb, only one of <a href="#_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a> and <a href="#_conf_backupfilesonly_">$Conf{BackupFilesOnly}</a> can be specified per share. If both are set for a particular share, then <a href="#_conf_backupfilesonly_">$Conf{BackupFilesOnly}</a> takes precedence and <a href="#_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a> is ignored.</p>
<p>When editing from the web interface, you should add a valid ShareName (based on <a href="#_conf_xfermethod_">$Conf{XferMethod}</a>), and then enter the directories or files specific to that ShareName. A special ShareName "*" matches any ShareName that doesn't have an explicit entry.</p>
<p>This can be set to a string, an array of strings, or, in the case of multiple shares, a hash of strings or arrays. A hash is used to give a list of directories or files to exclude for each share (the share name is the key). If this is set to just a string or array, and <a href="#_conf_smbsharename_">$Conf{SmbShareName}</a> contains multiple share names, then the setting is assumed to apply to all shares.</p>
<p>The exact behavior is determined by the underlying transport program, smbclient or tar. For smbclient the exlclude file list is passed into the X option. Simple shell wild-cards using "*" or "?" are allowed.</p>
<p>For tar, if the exclude file contains a "/" it is assumed to be anchored at the start of the string. Since all the tar paths start with "./", BackupPC prepends a "." if the exclude file starts with a "/". Note that GNU tar version >= 1.13.7 is required for the exclude option to work correctly. For linux or unix machines you should add "/proc" to <a href="#_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a> unless you have specified --one-file-system in <a href="#_conf_tarclientcmd_">$Conf{TarClientCmd}</a> or --one-file-system in <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a>. Also, for tar, do not use a trailing "/" in the directory name: a trailing "/" causes the name to not match and the directory will not be excluded.</p>
<p>Users report that for smbclient you should specify a directory followed by "/*", eg: "/proc/*", instead of just "/proc".</p>
<p>FTP servers are traversed recursively so excluding directories will also exclude its contents. You can use the wildcard characters "*" and "?" to define files for inclusion and exclusion. Both attributes <a href="#_conf_backupfilesonly_">$Conf{BackupFilesOnly}</a> and <a href="#_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a> can be defined for the same share.</p>
<p>If a hash is used, a special key "*" means it applies to all shares that don't have a specific entry.</p>
<p>Examples:</p>
<pre><code> <a href="#_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a> = '/temp';
<a href="#_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a> = ['/temp']; # same as first example
<a href="#_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a> = ['/temp', '/winnt/tmp'];
<a href="#_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a> = {
'c' => ['/temp', '/winnt/tmp'], # these are for 'c' share
'd' => ['/junk', '/dont_back_this_up'], # these are for 'd' share
};
<a href="#_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a> = {
'c' => ['/temp', '/winnt/tmp'], # these are for 'c' share
'*' => ['/junk', '/dont_back_this_up'], # these are for other shares
};</code></pre>
</dd>
<strong><dt id="_conf_blackoutbadpinglimit_">$Conf{BlackoutBadPingLimit}</a> = 3;</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_blackoutgoodcnt_">$Conf{BlackoutGoodCnt}</a> = 7;</dt></strong>
<dd>
<p>PCs that are always or often on the network can be backed up after hours, to reduce PC, network and server load during working hours. For each PC a count of consecutive good pings is maintained. Once a PC has at least <a href="#_conf_blackoutgoodcnt_">$Conf{BlackoutGoodCnt}</a> consecutive good pings it is subject to "blackout" and not backed up during hours and days specified by <a href="#_conf_blackoutperiods_">$Conf{BlackoutPeriods}</a>.</p>
<p>To allow for periodic rebooting of a PC or other brief periods when a PC is not on the network, a number of consecutive bad pings is allowed before the good ping count is reset. This parameter is <a href="#_conf_blackoutbadpinglimit_">$Conf{BlackoutBadPingLimit}</a>.</p>
<p>Note that bad and good pings don't occur with the same interval. If a machine is always on the network, it will only be pinged roughly once every <a href="#_conf_incrperiod_">$Conf{IncrPeriod}</a> (eg: once per day). So a setting for <a href="#_conf_blackoutgoodcnt_">$Conf{BlackoutGoodCnt}</a> of 7 means it will take around 7 days for a machine to be subject to blackout. On the other hand, if a ping is failed, it will be retried roughly every time BackupPC wakes up, eg, every one or two hours. So a setting for <a href="#_conf_blackoutbadpinglimit_">$Conf{BlackoutBadPingLimit}</a> of 3 means that the PC will lose its blackout status after 3-6 hours of unavailability.</p>
<p>To disable the blackout feature set <a href="#_conf_blackoutgoodcnt_">$Conf{BlackoutGoodCnt}</a> to a negative value. A value of 0 will make all machines subject to blackout. But if you don't want to do any backups during the day it would be easier to just set <a href="#_conf_wakeupschedule_">$Conf{WakeupSchedule}</a> to a restricted schedule.</p>
</dd>
<strong><dt id="_conf_blackoutperiods_">$Conf{BlackoutPeriods}</a> = [ ... ];</dt></strong>
<dd>
<p>One or more blackout periods can be specified. If a client is subject to blackout then no regular (non-manual) backups will be started during any of these periods. hourBegin and hourEnd specify hours fro midnight and weekDays is a list of days of the week where 0 is Sunday, 1 is Monday etc.</p>
<p>For example:</p>
<pre><code> <a href="#_conf_blackoutperiods_">$Conf{BlackoutPeriods}</a> = [
{
hourBegin => 7.0,
hourEnd => 19.5,
weekDays => [1, 2, 3, 4, 5],
},
];</code></pre>
<p>specifies one blackout period from 7:00am to 7:30pm local time on Mon-Fri.</p>
<p>The blackout period can also span midnight by setting hourBegin > hourEnd, eg:</p>
<pre><code> <a href="#_conf_blackoutperiods_">$Conf{BlackoutPeriods}</a> = [
{
hourBegin => 7.0,
hourEnd => 19.5,
weekDays => [1, 2, 3, 4, 5],
},
{
hourBegin => 23,
hourEnd => 5,
weekDays => [5, 6],
},
];</code></pre>
<p>This specifies one blackout period from 7:00am to 7:30pm local time on Mon-Fri, and a second period from 11pm to 5am on Friday and Saturday night.</p>
</dd>
<strong><dt id="_conf_backupzerofilesisfatal_">$Conf{BackupZeroFilesIsFatal}</a> = 1;</dt></strong>
<dd>
<p>A backup of a share that has zero files is considered fatal. This is used to catch miscellaneous Xfer errors that result in no files being backed up. If you have shares that might be empty (and therefore an empty backup is valid) you should set this flag to 0.</p>
</dd>
</dl>
<h2 id="How-to-backup-a-client">How to backup a client</h2>
<dl>
<strong><dt id="_conf_xfermethod_">$Conf{XferMethod}</a> = 'smb';</dt></strong>
<dd>
<p>What transport method to use to backup each host. If you have a mixed set of WinXX and linux/unix hosts you will need to override this in the per-PC config.pl.</p>
<p>The valid values are:</p>
<pre><code> - 'smb': backup and restore via smbclient and the SMB protocol.
Easiest choice for WinXX.
- 'rsync': backup and restore via rsync (via rsh or ssh).
Best choice for linux/unix. Good choice also for WinXX.
- 'rsyncd': backup and restore via rsync daemon on the client.
Best choice for linux/unix if you have rsyncd running on
the client. Good choice also for WinXX.
- 'tar': backup and restore via tar, tar over ssh, rsh or nfs.
Good choice for linux/unix.
- 'archive': host is a special archive host. Backups are not done.
An archive host is used to archive other host's backups
to permanent media, such as tape, CDR or DVD.</code></pre>
</dd>
<strong><dt id="_conf_xferloglevel_">$Conf{XferLogLevel}</a> = 1;</dt></strong>
<dd>
<p>Level of verbosity in Xfer log files. 0 means be quiet, 1 will give will give one line per file, 2 will also show skipped files on incrementals, higher values give more output.</p>
</dd>
<strong><dt id="_conf_clientcharset_">$Conf{ClientCharset}</a> = '';</dt></strong>
<dd>
<p>Filename charset encoding on the client. BackupPC uses utf8 on the server for filename encoding. If this is empty, then utf8 is assumed and client filenames will not be modified. If set to a different encoding then filenames will converted to/from utf8 automatically during backup and restore.</p>
<p>If the file names displayed in the browser (eg: accents or special characters) don't look right then it is likely you haven't set <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a> correctly.</p>
<p>If you are using smbclient on a WinXX machine, smbclient will convert to the "unix charset" setting in smb.conf. The default is utf8, in which case leave <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a> empty since smbclient does the right conversion.</p>
<p>If you are using rsync on a WinXX machine then it does no conversion. A typical WinXX encoding for latin1/western europe is 'cp1252', so in this case set <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a> to 'cp1252'.</p>
<p>On a linux or unix client, run "locale charmap" to see the client's charset. Set <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a> to this value. A typical value for english/US is 'ISO-8859-1'.</p>
<p>Do "perldoc Encode::Supported" to see the list of possible charset values. The FAQ at http://www.cl.cam.ac.uk/~mgk25/unicode.html is excellent, and http://czyborra.com/charsets/iso8859.html provides more information on the iso-8859 charsets.</p>
</dd>
<strong><dt id="_conf_clientcharsetlegacy_">$Conf{ClientCharsetLegacy}</a> = 'iso-8859-1';</dt></strong>
<dd>
<p>Prior to 3.x no charset conversion was done by BackupPC. Backups were stored in what ever charset the XferMethod provided - typically utf8 for smbclient and the client's locale settings for rsync and tar (eg: cp1252 for rsync on WinXX and perhaps iso-8859-1 with rsync on linux). This setting tells BackupPC the charset that was used to store file names in old backups taken with BackupPC 2.x, so that non-ascii file names in old backups can be viewed and restored.</p>
</dd>
</dl>
<h2 id="Samba-Configuration">Samba Configuration</h2>
<dl>
<strong><dt id="_conf_smbsharename_">$Conf{SmbShareName}</a> = 'C$';</dt></strong>
<dd>
<p>Name of the host share that is backed up when using SMB. This can be a string or an array of strings if there are multiple shares per host. Examples:</p>
<pre><code> <a href="#_conf_smbsharename_">$Conf{SmbShareName}</a> = 'c'; # backup 'c' share
<a href="#_conf_smbsharename_">$Conf{SmbShareName}</a> = ['c', 'd']; # backup 'c' and 'd' shares</code></pre>
<p>This setting only matters if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'smb'.</p>
</dd>
<strong><dt id="_conf_smbshareusername_">$Conf{SmbShareUserName}</a> = '';</dt></strong>
<dd>
<p>Smbclient share user name. This is passed to smbclient's -U argument.</p>
<p>This setting only matters if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'smb'.</p>
</dd>
<strong><dt id="_conf_smbsharepasswd_">$Conf{SmbSharePasswd}</a> = '';</dt></strong>
<dd>
<p>Smbclient share password. This is passed to smbclient via its PASSWD environment variable. There are several ways you can tell BackupPC the smb share password. In each case you should be very careful about security. If you put the password here, make sure that this file is not readable by regular users! See the "Setting up config.pl" section in the documentation for more information.</p>
<p>This setting only matters if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'smb'.</p>
</dd>
<strong><dt id="_conf_smbclientpath_">$Conf{SmbClientPath}</a> = '';</dt></strong>
<dd>
<p>Full path for smbclient. Security caution: normal users should not allowed to write to this file or directory.</p>
<p>smbclient is from the Samba distribution. smbclient is used to actually extract the incremental or full dump of the share filesystem from the PC.</p>
<p>This setting only matters if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'smb'.</p>
</dd>
<strong><dt id="_conf_smbclientfullcmd_">$Conf{SmbClientFullCmd}</a> = '$smbClientPath \\\\$host\\$shareName' ...</dt></strong>
<dd>
<p>Command to run smbclient for a full dump. This setting only matters if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'smb'.</p>
<p>The following variables are substituted at run-time:</p>
<pre><code> $smbClientPath same as <a href="#_conf_smbclientpath_">$Conf{SmbClientPath}</a>
$host host to backup/restore
$hostIP host IP address
$shareName share name
$userName user name
$fileList list of files to backup (based on exclude/include)
$I_option optional -I option to smbclient
$X_option exclude option (if $fileList is an exclude list)
$timeStampFile start time for incremental dump</code></pre>
<p>Note: all Cmds are executed directly without a shell, so the prog name needs to be a full path and you can't include shell syntax like redirection and pipes; put that in a script if you need it.</p>
</dd>
<strong><dt id="_conf_smbclientincrcmd_">$Conf{SmbClientIncrCmd}</a> = '$smbClientPath \\\\$host\\$shareName' ...</dt></strong>
<dd>
<p>Command to run smbclient for an incremental dump. This setting only matters if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'smb'.</p>
<p>Same variable substitutions are applied as <a href="#_conf_smbclientfullcmd_">$Conf{SmbClientFullCmd}</a>.</p>
<p>Note: all Cmds are executed directly without a shell, so the prog name needs to be a full path and you can't include shell syntax like redirection and pipes; put that in a script if you need it.</p>
</dd>
<strong><dt id="_conf_smbclientrestorecmd_">$Conf{SmbClientRestoreCmd}</a> = '$smbClientPath \\\\$host\\$shareName' ...</dt></strong>
<dd>
<p>Command to run smbclient for a restore. This setting only matters if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'smb'.</p>
<p>Same variable substitutions are applied as <a href="#_conf_smbclientfullcmd_">$Conf{SmbClientFullCmd}</a>.</p>
<p>If your smb share is read-only then direct restores will fail. You should set <a href="#_conf_smbclientrestorecmd_">$Conf{SmbClientRestoreCmd}</a> to undef and the corresponding CGI restore option will be removed.</p>
<p>Note: all Cmds are executed directly without a shell, so the prog name needs to be a full path and you can't include shell syntax like redirection and pipes; put that in a script if you need it.</p>
</dd>
</dl>
<h2 id="Tar-Configuration">Tar Configuration</h2>
<dl>
<strong><dt id="_conf_tarsharename_">$Conf{TarShareName}</a> = '/';</dt></strong>
<dd>
<p>Which host directories to backup when using tar transport. This can be a string or an array of strings if there are multiple directories to backup per host. Examples:</p>
<pre><code> <a href="#_conf_tarsharename_">$Conf{TarShareName}</a> = '/'; # backup everything
<a href="#_conf_tarsharename_">$Conf{TarShareName}</a> = '/home'; # only backup /home
<a href="#_conf_tarsharename_">$Conf{TarShareName}</a> = ['/home', '/src']; # backup /home and /src</code></pre>
<p>The fact this parameter is called 'TarShareName' is for historical consistency with the Smb transport options. You can use any valid directory on the client: there is no need for it to correspond to any Smb share or device mount point.</p>
<p>Note also that you can also use <a href="#_conf_backupfilesonly_">$Conf{BackupFilesOnly}</a> to specify a specific list of directories to backup. It's more efficient to use this option instead of <a href="#_conf_tarsharename_">$Conf{TarShareName}</a> since a new tar is run for each entry in <a href="#_conf_tarsharename_">$Conf{TarShareName}</a>.</p>
<p>On the other hand, if you add --one-file-system to <a href="#_conf_tarclientcmd_">$Conf{TarClientCmd}</a> you can backup each file system separately, which makes restoring one bad file system easier. In this case you would list all of the mount points here, since you can't get the same result with <a href="#_conf_backupfilesonly_">$Conf{BackupFilesOnly}</a>:</p>
<pre><code> <a href="#_conf_tarsharename_">$Conf{TarShareName}</a> = ['/', '/var', '/data', '/boot'];</code></pre>
<p>This setting only matters if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'tar'.</p>
</dd>
<strong><dt id="_conf_tarclientcmd_">$Conf{TarClientCmd}</a> = '$sshPath -q -x -n -l root $host' ...</dt></strong>
<dd>
<p>Command to run tar on the client. GNU tar is required. You will need to fill in the correct paths for ssh2 on the local host (server) and GNU tar on the client. Security caution: normal users should not allowed to write to these executable files or directories.</p>
<p><a href="#_conf_tarclientcmd_">$Conf{TarClientCmd}</a> is appended with with either <a href="#_conf_tarfullargs_">$Conf{TarFullArgs}</a> or <a href="#_conf_tarincrargs_">$Conf{TarIncrArgs}</a> to create the final command that is run.</p>
<p>See the documentation for more information about setting up ssh2 keys.</p>
<p>If you plan to use NFS then tar just runs locally and ssh2 is not needed. For example, assuming the client filesystem is mounted below /mnt/hostName, you could use something like:</p>
<pre><code> <a href="#_conf_tarclientcmd_">$Conf{TarClientCmd}</a> = '$tarPath -c -v -f - -C /mnt/$host/$shareName'
. ' --totals';</code></pre>
<p>In the case of NFS or rsh you need to make sure BackupPC's privileges are sufficient to read all the files you want to backup. Also, you will probably want to add "/proc" to <a href="#_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a>.</p>
<p>The following variables are substituted at run-time:</p>
<pre><code> $host host name
$hostIP host's IP address
$incrDate newer-than date for incremental backups
$shareName share name to backup (ie: top-level directory path)
$fileList specific files to backup or exclude
$tarPath same as <a href="#_conf_tarclientpath_">$Conf{TarClientPath}</a>
$sshPath same as <a href="#_conf_sshpath_">$Conf{SshPath}</a></code></pre>
<p>If a variable is followed by a "+" it is shell escaped. This is necessary for the command part of ssh or rsh, since it ends up getting passed through the shell.</p>
<p>This setting only matters if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'tar'.</p>
<p>Note: all Cmds are executed directly without a shell, so the prog name needs to be a full path and you can't include shell syntax like redirection and pipes; put that in a script if you need it.</p>
</dd>
<strong><dt id="_conf_tarfullargs_">$Conf{TarFullArgs}</a> = '$fileList+';</dt></strong>
<dd>
<p>Extra tar arguments for full backups. Several variables are substituted at run-time. See <a href="#_conf_tarclientcmd_">$Conf{TarClientCmd}</a> for the list of variable substitutions.</p>
<p>If you are running tar locally (ie: without rsh or ssh) then remove the "+" so that the argument is no longer shell escaped.</p>
<p>This setting only matters if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'tar'.</p>
</dd>
<strong><dt id="_conf_tarincrargs_">$Conf{TarIncrArgs}</a> = '--newer=$incrDate+ $fileList+';</dt></strong>
<dd>
<p>Extra tar arguments for incr backups. Several variables are substituted at run-time. See <a href="#_conf_tarclientcmd_">$Conf{TarClientCmd}</a> for the list of variable substitutions.</p>
<p>Note that GNU tar has several methods for specifying incremental backups, including:</p>
<pre><code> --newer-mtime $incrDate+
This causes a file to be included if the modification time is
later than $incrDate (meaning its contents might have changed).
But changes in the ownership or modes will not qualify the
file to be included in an incremental.
--newer=$incrDate+
This causes the file to be included if any attribute of the
file is later than $incrDate, meaning either attributes or
the modification time. This is the default method. Do
not use --atime-preserve in <a href="#_conf_tarclientcmd_">$Conf{TarClientCmd}</a> above,
otherwise resetting the atime (access time) counts as an
attribute change, meaning the file will always be included
in each new incremental dump.</code></pre>
<p>If you are running tar locally (ie: without rsh or ssh) then remove the "+" so that the argument is no longer shell escaped.</p>
<p>This setting only matters if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'tar'.</p>
</dd>
<strong><dt id="_conf_tarclientrestorecmd_">$Conf{TarClientRestoreCmd}</a> = '$sshPath -q -x -l root $host' ...</dt></strong>
<dd>
<p>Full command to run tar for restore on the client. GNU tar is required. This can be the same as <a href="#_conf_tarclientcmd_">$Conf{TarClientCmd}</a>, with tar's -c replaced by -x and ssh's -n removed.</p>
<p>See <a href="#_conf_tarclientcmd_">$Conf{TarClientCmd}</a> for full details.</p>
<p>This setting only matters if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = "tar".</p>
<p>If you want to disable direct restores using tar, you should set <a href="#_conf_tarclientrestorecmd_">$Conf{TarClientRestoreCmd}</a> to undef and the corresponding CGI restore option will be removed.</p>
<p>Note: all Cmds are executed directly without a shell, so the prog name needs to be a full path and you can't include shell syntax like redirection and pipes; put that in a script if you need it.</p>
</dd>
<strong><dt id="_conf_tarclientpath_">$Conf{TarClientPath}</a> = '';</dt></strong>
<dd>
<p>Full path for tar on the client. Security caution: normal users should not allowed to write to this file or directory.</p>
<p>This setting only matters if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'tar'.</p>
</dd>
</dl>
<h2 id="Rsync-Rsyncd-Configuration">Rsync/Rsyncd Configuration</h2>
<dl>
<strong><dt id="_conf_rsyncclientpath_">$Conf{RsyncClientPath}</a> = '';</dt></strong>
<dd>
<p>Path to rsync executable on the client</p>
</dd>
<strong><dt id="_conf_rsyncclientcmd_">$Conf{RsyncClientCmd}</a> = '$sshPath -q -x -l root $host $rsyncPath $argList+';</dt></strong>
<dd>
<p>Full command to run rsync on the client machine. The following variables are substituted at run-time:</p>
<pre><code> $host host name being backed up
$hostIP host's IP address
$shareName share name to backup (ie: top-level directory path)
$rsyncPath same as <a href="#_conf_rsyncclientpath_">$Conf{RsyncClientPath}</a>
$sshPath same as <a href="#_conf_sshpath_">$Conf{SshPath}</a>
$argList argument list, built from <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a>,
$shareName, <a href="#_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a> and
<a href="#_conf_backupfilesonly_">$Conf{BackupFilesOnly}</a></code></pre>
<p>This setting only matters if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'rsync'.</p>
</dd>
<strong><dt id="_conf_rsyncclientrestorecmd_">$Conf{RsyncClientRestoreCmd}</a> = '$sshPath -q -x -l root $host $rsyncPath $argList+';</dt></strong>
<dd>
<p>Full command to run rsync for restore on the client. The following variables are substituted at run-time:</p>
<pre><code> $host host name being backed up
$hostIP host's IP address
$shareName share name to backup (ie: top-level directory path)
$rsyncPath same as <a href="#_conf_rsyncclientpath_">$Conf{RsyncClientPath}</a>
$sshPath same as <a href="#_conf_sshpath_">$Conf{SshPath}</a>
$argList argument list, built from <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a>,
$shareName, <a href="#_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a> and
<a href="#_conf_backupfilesonly_">$Conf{BackupFilesOnly}</a></code></pre>
<p>This setting only matters if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'rsync'.</p>
<p>Note: all Cmds are executed directly without a shell, so the prog name needs to be a full path and you can't include shell syntax like redirection and pipes; put that in a script if you need it.</p>
</dd>
<strong><dt id="_conf_rsyncsharename_">$Conf{RsyncShareName}</a> = '/';</dt></strong>
<dd>
<p>Share name to backup. For <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = "rsync" this should be a file system path, eg '/' or '/home'.</p>
<p>For <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = "rsyncd" this should be the name of the module to backup (ie: the name from /etc/rsynd.conf).</p>
<p>This can also be a list of multiple file system paths or modules. For example, by adding --one-file-system to <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a> you can backup each file system separately, which makes restoring one bad file system easier. In this case you would list all of the mount points:</p>
<pre><code> <a href="#_conf_rsyncsharename_">$Conf{RsyncShareName}</a> = ['/', '/var', '/data', '/boot'];</code></pre>
</dd>
<strong><dt id="_conf_rsyncdclientport_">$Conf{RsyncdClientPort}</a> = 873;</dt></strong>
<dd>
<p>Rsync daemon port on the client, for <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = "rsyncd".</p>
</dd>
<strong><dt id="_conf_rsyncdusername_">$Conf{RsyncdUserName}</a> = '';</dt></strong>
<dd>
<p>Rsync daemon user name on client, for <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = "rsyncd". The user name and password are stored on the client in whatever file the "secrets file" parameter in rsyncd.conf points to (eg: /etc/rsyncd.secrets).</p>
</dd>
<strong><dt id="_conf_rsyncdpasswd_">$Conf{RsyncdPasswd}</a> = '';</dt></strong>
<dd>
<p>Rsync daemon user name on client, for <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = "rsyncd". The user name and password are stored on the client in whatever file the "secrets file" parameter in rsyncd.conf points to (eg: /etc/rsyncd.secrets).</p>
</dd>
<strong><dt id="_conf_rsyncdauthrequired_">$Conf{RsyncdAuthRequired}</a> = 1;</dt></strong>
<dd>
<p>Whether authentication is mandatory when connecting to the client's rsyncd. By default this is on, ensuring that BackupPC will refuse to connect to an rsyncd on the client that is not password protected. Turn off at your own risk.</p>
</dd>
<strong><dt id="_conf_rsynccsumcacheverifyprob_">$Conf{RsyncCsumCacheVerifyProb}</a> = 0.01;</dt></strong>
<dd>
<p>When rsync checksum caching is enabled (by adding the --checksum-seed=32761 option to <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a>), the cached checksums can be occasionally verified to make sure the file contents matches the cached checksums. This is to avoid the risk that disk problems might cause the pool file contents to get corrupted, but the cached checksums would make BackupPC think that the file still matches the client.</p>
<p>This setting is the probability (0 means never and 1 means always) that a file will be rechecked. Setting it to 0 means the checksums will not be rechecked (unless there is a phase 0 failure). Setting it to 1 (ie: 100%) means all files will be checked, but that is not a desirable setting since you are better off simply turning caching off (ie: remove the --checksum-seed option).</p>
<p>The default of 0.01 means 1% (on average) of the files during a full backup will have their cached checksum re-checked.</p>
<p>This setting has no effect unless checksum caching is turned on.</p>
</dd>
<strong><dt id="_conf_rsyncargs_">$Conf{RsyncArgs}</a> = [ ... ];</dt></strong>
<dd>
<p>Arguments to rsync for backup. Do not edit the first set unless you have a thorough understanding of how File::RsyncP works.</p>
</dd>
<strong><dt id="_conf_rsyncargsextra_">$Conf{RsyncArgsExtra}</a> = [];</dt></strong>
<dd>
<p>Additional arguments added to RsyncArgs. This can be used in conbination with <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a> to allow customization of the rsync arguments on a part-client basis. The standard arguments go in <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a> and <a href="#_conf_rsyncargsextra_">$Conf{RsyncArgsExtra}</a> can be set on a per-client basis.</p>
<p>Examples of additional arguments that should work are --exclude/--include, eg:</p>
<pre><code> <a href="#_conf_rsyncargsextra_">$Conf{RsyncArgsExtra}</a> = [
'--exclude', '/proc',
'--exclude', '*.tmp',
];</code></pre>
<p>Both <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a> and <a href="#_conf_rsyncargsextra_">$Conf{RsyncArgsExtra}</a> are subject to the following variable substitutions:</p>
<pre><code> $client client name being backed up
$host host name (could be different from client name if
<a href="#_conf_clientnamealias_">$Conf{ClientNameAlias}</a> is set)
$hostIP IP address of host
$confDir configuration directory path</code></pre>
<p>This allows settings of the form:</p>
<pre><code> <a href="#_conf_rsyncargsextra_">$Conf{RsyncArgsExtra}</a> = [
'--exclude-from=$confDir/pc/$host.exclude',
];</code></pre>
</dd>
<strong><dt id="_conf_rsyncrestoreargs_">$Conf{RsyncRestoreArgs}</a> = [ ... ];</dt></strong>
<dd>
<p>Arguments to rsync for restore. Do not edit the first set unless you have a thorough understanding of how File::RsyncP works.</p>
<p>If you want to disable direct restores using rsync (eg: is the module is read-only), you should set <a href="#_conf_rsyncrestoreargs_">$Conf{RsyncRestoreArgs}</a> to undef and the corresponding CGI restore option will be removed.</p>
<p><a href="#_conf_rsyncrestoreargs_">$Conf{RsyncRestoreArgs}</a> is subject to the following variable substitutions:</p>
<pre><code> $client client name being backed up
$host host name (could be different from client name if
<a href="#_conf_clientnamealias_">$Conf{ClientNameAlias}</a> is set)
$hostIP IP address of host
$confDir configuration directory path</code></pre>
<p>Note: <a href="#_conf_rsyncargsextra_">$Conf{RsyncArgsExtra}</a> doesn't apply to <a href="#_conf_rsyncrestoreargs_">$Conf{RsyncRestoreArgs}</a>.</p>
</dd>
</dl>
<h2 id="FTP-Configuration">FTP Configuration</h2>
<dl>
<strong><dt id="_conf_ftpsharename_">$Conf{FtpShareName}</a> = '';</dt></strong>
<dd>
<p>Which host directories to backup when using FTP. This can be a string or an array of strings if there are multiple shares per host.</p>
<p>This value must be specified in one of two ways: either as a subdirectory of the 'share root' on the server, or as the absolute path of the directory.</p>
<p>In the following example, if the directory /home/username is the root share of the ftp server with the given username, the following two values will back up the same directory:</p>
<pre><code> <a href="#_conf_ftpsharename_">$Conf{FtpShareName}</a> = 'www'; # www directory
<a href="#_conf_ftpsharename_">$Conf{FtpShareName}</a> = '/home/username/www'; # same directory</code></pre>
<p>Path resolution is not supported; i.e.; you may not have an ftp share path defined as '../otheruser' or '~/games'.</p>
<pre><code> Multiple shares may also be specified, as with other protocols:
<a href="#_conf_ftpsharename_">$Conf{FtpShareName}</a> = [ 'www',
'bin',
'config' ];</code></pre>
<p>Note also that you can also use <a href="#_conf_backupfilesonly_">$Conf{BackupFilesOnly}</a> to specify a specific list of directories to backup. It's more efficient to use this option instead of <a href="#_conf_ftpsharename_">$Conf{FtpShareName}</a> since a new tar is run for each entry in <a href="#_conf_ftpsharename_">$Conf{FtpShareName}</a>.</p>
<p>This setting only matters if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'ftp'.</p>
</dd>
<strong><dt id="_conf_ftpusername_">$Conf{FtpUserName}</a> = '';</dt></strong>
<dd>
<p>FTP user name. This is used to log into the server.</p>
<p>This setting is used only if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'ftp'.</p>
</dd>
<strong><dt id="_conf_ftppasswd_">$Conf{FtpPasswd}</a> = '';</dt></strong>
<dd>
<p>FTP user password. This is used to log into the server.</p>
<p>This setting is used only if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'ftp'.</p>
</dd>
<strong><dt id="_conf_ftppassive_">$Conf{FtpPassive}</a> = 1;</dt></strong>
<dd>
<p>Whether passive mode is used. The correct setting depends upon whether local or remote ports are accessible from the other machine, which is affected by any firewall or routers between the FTP server on the client and the BackupPC server.</p>
<p>This setting is used only if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'ftp'.</p>
</dd>
<strong><dt id="_conf_ftpblocksize_">$Conf{FtpBlockSize}</a> = 10240;</dt></strong>
<dd>
<p>Transfer block size. This sets the size of the amounts of data in each frame. While undefined, this value takes the default value.</p>
<p>This setting is used only if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'ftp'.</p>
</dd>
<strong><dt id="_conf_ftpport_">$Conf{FtpPort}</a> = 21;</dt></strong>
<dd>
<p>The port of the ftp server. If undefined, 21 is used.</p>
<p>This setting is used only if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'ftp'.</p>
</dd>
<strong><dt id="_conf_ftptimeout_">$Conf{FtpTimeout}</a> = 120;</dt></strong>
<dd>
<p>Connection timeout for FTP. When undefined, the default is 120 seconds.</p>
<p>This setting is used only if <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'ftp'.</p>
</dd>
<strong><dt id="_conf_ftpfollowsymlinks_">$Conf{FtpFollowSymlinks}</a> = 0;</dt></strong>
<dd>
<p>Behaviour when BackupPC encounters symlinks on the FTP share.</p>
<p>Symlinks cannot be restored via FTP, so the desired behaviour will be different depending on the setup of the share. The default for this behavor is 1. Directory shares with more complicated directory structures should consider other protocols.</p>
</dd>
</dl>
<h2 id="Archive-Configuration">Archive Configuration</h2>
<dl>
<strong><dt id="_conf_archivedest_">$Conf{ArchiveDest}</a> = '/tmp';</dt></strong>
<dd>
<p>Archive Destination</p>
<p>The Destination of the archive e.g. /tmp for file archive or /dev/nst0 for device archive</p>
</dd>
<strong><dt id="_conf_archivecomp_">$Conf{ArchiveComp}</a> = 'gzip';</dt></strong>
<dd>
<p>Archive Compression type</p>
<p>The valid values are:</p>
<pre><code> - 'none': No Compression
- 'gzip': Medium Compression. Recommended.
- 'bzip2': High Compression but takes longer.</code></pre>
</dd>
<strong><dt id="_conf_archivepar_">$Conf{ArchivePar}</a> = 0;</dt></strong>
<dd>
<p>Archive Parity Files</p>
<p>The amount of Parity data to generate, as a percentage of the archive size. Uses the commandline par2 (par2cmdline) available from http://parchive.sourceforge.net</p>
<p>Only useful for file dumps.</p>
<p>Set to 0 to disable this feature.</p>
</dd>
<strong><dt id="_conf_archivesplit_">$Conf{ArchiveSplit}</a> = 0;</dt></strong>
<dd>
<p>Archive Size Split</p>
<p>Only for file archives. Splits the output into the specified size * 1,000,000. e.g. to split into 650,000,000 bytes, specify 650 below.</p>
<p>If the value is 0, or if <a href="#_conf_archivedest_">$Conf{ArchiveDest}</a> is an existing file or device (e.g. a streaming tape drive), this feature is disabled.</p>
</dd>
<strong><dt id="_conf_archiveclientcmd_">$Conf{ArchiveClientCmd}</a> = '$Installdir/bin/BackupPC_archiveHost' ...</dt></strong>
<dd>
<p>Archive Command</p>
<p>This is the command that is called to actually run the archive process for each host. The following variables are substituted at run-time:</p>
<pre><code> $Installdir The installation directory of BackupPC
$tarCreatePath The path to BackupPC_tarCreate
$splitpath The path to the split program
$parpath The path to the par2 program
$host The host to archive
$backupnumber The backup number of the host to archive
$compression The path to the compression program
$compext The extension assigned to the compression type
$splitsize The number of bytes to split archives into
$archiveloc The location to put the archive
$parfile The amount of parity data to create (percentage)</code></pre>
<p>Note: all Cmds are executed directly without a shell, so the prog name needs to be a full path and you can't include shell syntax like redirection and pipes; put that in a script if you need it.</p>
</dd>
<strong><dt id="_conf_sshpath_">$Conf{SshPath}</a> = '';</dt></strong>
<dd>
<p>Full path for ssh. Security caution: normal users should not allowed to write to this file or directory.</p>
</dd>
<strong><dt id="_conf_nmblookuppath_">$Conf{NmbLookupPath}</a> = '';</dt></strong>
<dd>
<p>Full path for nmblookup. Security caution: normal users should not allowed to write to this file or directory.</p>
<p>nmblookup is from the Samba distribution. nmblookup is used to get the netbios name, necessary for DHCP hosts.</p>
</dd>
<strong><dt id="_conf_nmblookupcmd_">$Conf{NmbLookupCmd}</a> = '$nmbLookupPath -A $host';</dt></strong>
<dd>
<p>NmbLookup command. Given an IP address, does an nmblookup on that IP address. The following variables are substituted at run-time:</p>
<pre><code> $nmbLookupPath path to nmblookup (<a href="#_conf_nmblookuppath_">$Conf{NmbLookupPath}</a>)
$host IP address</code></pre>
<p>This command is only used for DHCP hosts: given an IP address, this command should try to find its NetBios name.</p>
<p>Note: all Cmds are executed directly without a shell, so the prog name needs to be a full path and you can't include shell syntax like redirection and pipes; put that in a script if you need it.</p>
</dd>
<strong><dt id="_conf_nmblookupfindhostcmd_">$Conf{NmbLookupFindHostCmd}</a> = '$nmbLookupPath $host';</dt></strong>
<dd>
<p>NmbLookup command. Given a netbios name, finds that host by doing a NetBios lookup. Several variables are substituted at run-time:</p>
<pre><code> $nmbLookupPath path to nmblookup (<a href="#_conf_nmblookuppath_">$Conf{NmbLookupPath}</a>)
$host NetBios name</code></pre>
<p>In some cases you might need to change the broadcast address, for example if nmblookup uses 192.168.255.255 by default and you find that doesn't work, try 192.168.1.255 (or your equivalent class C address) using the -B option:</p>
<pre><code> <a href="#_conf_nmblookupfindhostcmd_">$Conf{NmbLookupFindHostCmd}</a> = '$nmbLookupPath -B 192.168.1.255 $host';</code></pre>
<p>If you use a WINS server and your machines don't respond to multicast NetBios requests you can use this (replace 1.2.3.4 with the IP address of your WINS server):</p>
<pre><code> <a href="#_conf_nmblookupfindhostcmd_">$Conf{NmbLookupFindHostCmd}</a> = '$nmbLookupPath -R -U 1.2.3.4 $host';</code></pre>
<p>This is preferred over multicast since it minimizes network traffic.</p>
<p>Experiment manually for your site to see what form of nmblookup command works.</p>
<p>Note: all Cmds are executed directly without a shell, so the prog name needs to be a full path and you can't include shell syntax like redirection and pipes; put that in a script if you need it.</p>
</dd>
<strong><dt id="_conf_fixedipnetbiosnamecheck_">$Conf{FixedIPNetBiosNameCheck}</a> = 0;</dt></strong>
<dd>
<p>For fixed IP address hosts, BackupPC_dump can also verify the netbios name to ensure it matches the host name. An error is generated if they do not match. Typically this flag is off. But if you are going to transition a bunch of machines from fixed host addresses to DHCP, setting this flag is a great way to verify that the machines have their netbios name set correctly before turning on DCHP.</p>
</dd>
<strong><dt id="_conf_pingpath_">$Conf{PingPath}</a> = '';</dt></strong>
<dd>
<p>Full path to the ping command. Security caution: normal users should not be allowed to write to this file or directory.</p>
<p>If you want to disable ping checking, set this to some program that exits with 0 status, eg:</p>
<pre><code> <a href="#_conf_pingpath_">$Conf{PingPath}</a> = '/bin/echo';</code></pre>
</dd>
<strong><dt id="_conf_pingcmd_">$Conf{PingCmd}</a> = '$pingPath -c 1 $host';</dt></strong>
<dd>
<p>Ping command. The following variables are substituted at run-time:</p>
<pre><code> $pingPath path to ping (<a href="#_conf_pingpath_">$Conf{PingPath}</a>)
$host host name</code></pre>
<p>Wade Brown reports that on solaris 2.6 and 2.7 ping -s returns the wrong exit status (0 even on failure). Replace with "ping $host 1", which gets the correct exit status but we don't get the round-trip time.</p>
<p>Note: all Cmds are executed directly without a shell, so the prog name needs to be a full path and you can't include shell syntax like redirection and pipes; put that in a script if you need it.</p>
</dd>
<strong><dt id="_conf_pingmaxmsec_">$Conf{PingMaxMsec}</a> = 20;</dt></strong>
<dd>
<p>Maximum round-trip ping time in milliseconds. This threshold is set to avoid backing up PCs that are remotely connected through WAN or dialup connections. The output from ping -s (assuming it is supported on your system) is used to check the round-trip packet time. On your local LAN round-trip times should be much less than 20msec. On most WAN or dialup connections the round-trip time will be typically more than 20msec. Tune if necessary.</p>
</dd>
<strong><dt id="_conf_compresslevel_">$Conf{CompressLevel}</a> = 0;</dt></strong>
<dd>
<p>Compression level to use on files. 0 means no compression. Compression levels can be from 1 (least cpu time, slightly worse compression) to 9 (most cpu time, slightly better compression). The recommended value is 3. Changing to 5, for example, will take maybe 20% more cpu time and will get another 2-3% additional compression. See the zlib documentation for more information about compression levels.</p>
<p>Changing compression on or off after backups have already been done will require both compressed and uncompressed pool files to be stored. This will increase the pool storage requirements, at least until all the old backups expire and are deleted.</p>
<p>It is ok to change the compression value (from one non-zero value to another non-zero value) after dumps are already done. Since BackupPC matches pool files by comparing the uncompressed versions, it will still correctly match new incoming files against existing pool files. The new compression level will take effect only for new files that are newly compressed and added to the pool.</p>
<p>If compression was off and you are enabling compression for the first time you can use the BackupPC_compressPool utility to compress the pool. This avoids having the pool grow to accommodate both compressed and uncompressed backups. See the documentation for more information.</p>
<p>Note: compression needs the Compress::Zlib perl library. If the Compress::Zlib library can't be found then <a href="#_conf_compresslevel_">$Conf{CompressLevel}</a> is forced to 0 (compression off).</p>
</dd>
<strong><dt id="_conf_clienttimeout_">$Conf{ClientTimeout}</a> = 72000;</dt></strong>
<dd>
<p>Timeout in seconds when listening for the transport program's (smbclient, tar etc) stdout. If no output is received during this time, then it is assumed that something has wedged during a backup, and the backup is terminated.</p>
<p>Note that stdout buffering combined with huge files being backed up could cause longish delays in the output from smbclient that BackupPC_dump sees, so in rare cases you might want to increase this value.</p>
<p>Despite the name, this parameter sets the timeout for all transport methods (tar, smb etc).</p>
</dd>
<strong><dt id="_conf_maxoldperpclogfiles_">$Conf{MaxOldPerPCLogFiles}</a> = 12;</dt></strong>
<dd>
<p>Maximum number of log files we keep around in each PC's directory (ie: pc/$host). These files are aged monthly. A setting of 12 means there will be at most the files LOG, LOG.0, LOG.1, ... LOG.11 in the pc/$host directory (ie: about a years worth). (Except this month's LOG, these files will have a .z extension if compression is on).</p>
<p>If you decrease this number after BackupPC has been running for a while you will have to manually remove the older log files.</p>
</dd>
<strong><dt id="_conf_dumppreusercmd_">$Conf{DumpPreUserCmd}</a> = undef;</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_dumppostusercmd_">$Conf{DumpPostUserCmd}</a> = undef;</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_dumppresharecmd_">$Conf{DumpPreShareCmd}</a> = undef;</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_dumppostsharecmd_">$Conf{DumpPostShareCmd}</a> = undef;</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_restorepreusercmd_">$Conf{RestorePreUserCmd}</a> = undef;</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_restorepostusercmd_">$Conf{RestorePostUserCmd}</a> = undef;</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_archivepreusercmd_">$Conf{ArchivePreUserCmd}</a> = undef;</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_archivepostusercmd_">$Conf{ArchivePostUserCmd}</a> = undef;</dt></strong>
<dd>
<p>Optional commands to run before and after dumps and restores, and also before and after each share of a dump.</p>
<p>Stdout from these commands will be written to the Xfer (or Restore) log file. One example of using these commands would be to shut down and restart a database server, dump a database to files for backup, or doing a snapshot of a share prior to a backup. Example:</p>
<pre><code> <a href="#_conf_dumppreusercmd_">$Conf{DumpPreUserCmd}</a> = '$sshPath -q -x -l root $host /usr/bin/dumpMysql';</code></pre>
<p>The following variable substitutions are made at run time for <a href="#_conf_dumppreusercmd_">$Conf{DumpPreUserCmd}</a>, <a href="#_conf_dumppostusercmd_">$Conf{DumpPostUserCmd}</a>, <a href="#_conf_dumppresharecmd_">$Conf{DumpPreShareCmd}</a> and <a href="#_conf_dumppostsharecmd_">$Conf{DumpPostShareCmd}</a>:</p>
<pre><code> $type type of dump (incr or full)
$xferOK 1 if the dump succeeded, 0 if it didn't
$client client name being backed up
$host host name (could be different from client name if
<a href="#_conf_clientnamealias_">$Conf{ClientNameAlias}</a> is set)
$hostIP IP address of host
$user user name from the hosts file
$moreUsers list of additional users from the hosts file
$share the first share name (or current share for
<a href="#_conf_dumppresharecmd_">$Conf{DumpPreShareCmd}</a> and <a href="#_conf_dumppostsharecmd_">$Conf{DumpPostShareCmd}</a>)
$shares list of all the share names
$XferMethod value of <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> (eg: tar, rsync, smb)
$sshPath value of <a href="#_conf_sshpath_">$Conf{SshPath}</a>,
$cmdType set to DumpPreUserCmd or DumpPostUserCmd</code></pre>
<p>The following variable substitutions are made at run time for <a href="#_conf_restorepreusercmd_">$Conf{RestorePreUserCmd}</a> and <a href="#_conf_restorepostusercmd_">$Conf{RestorePostUserCmd}</a>:</p>
<pre><code> $client client name being backed up
$xferOK 1 if the restore succeeded, 0 if it didn't
$host host name (could be different from client name if
<a href="#_conf_clientnamealias_">$Conf{ClientNameAlias}</a> is set)
$hostIP IP address of host
$user user name from the hosts file
$moreUsers list of additional users from the hosts file
$share the first share name
$XferMethod value of <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> (eg: tar, rsync, smb)
$sshPath value of <a href="#_conf_sshpath_">$Conf{SshPath}</a>,
$type set to "restore"
$bkupSrcHost host name of the restore source
$bkupSrcShare share name of the restore source
$bkupSrcNum backup number of the restore source
$pathHdrSrc common starting path of restore source
$pathHdrDest common starting path of destination
$fileList list of files being restored
$cmdType set to RestorePreUserCmd or RestorePostUserCmd</code></pre>
<p>The following variable substitutions are made at run time for <a href="#_conf_archivepreusercmd_">$Conf{ArchivePreUserCmd}</a> and <a href="#_conf_archivepostusercmd_">$Conf{ArchivePostUserCmd}</a>:</p>
<pre><code> $client client name being backed up
$xferOK 1 if the archive succeeded, 0 if it didn't
$host Name of the archive host
$user user name from the hosts file
$share the first share name
$XferMethod value of <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> (eg: tar, rsync, smb)
$HostList list of hosts being archived
$BackupList list of backup numbers for the hosts being archived
$archiveloc location where the archive is sent to
$parfile amount of parity data being generated (percentage)
$compression compression program being used (eg: cat, gzip, bzip2)
$compext extension used for compression type (eg: raw, gz, bz2)
$splitsize size of the files that the archive creates
$sshPath value of <a href="#_conf_sshpath_">$Conf{SshPath}</a>,
$type set to "archive"
$cmdType set to ArchivePreUserCmd or ArchivePostUserCmd</code></pre>
<p>Note: all Cmds are executed directly without a shell, so the prog name needs to be a full path and you can't include shell syntax like redirection and pipes; put that in a script if you need it.</p>
</dd>
<strong><dt id="_conf_usercmdcheckstatus_">$Conf{UserCmdCheckStatus}</a> = 0;</dt></strong>
<dd>
<p>Whether the exit status of each PreUserCmd and PostUserCmd is checked.</p>
<p>If set and the Dump/Restore/Archive Pre/Post UserCmd returns a non-zero exit status then the dump/restore/archive is aborted. To maintain backward compatibility (where the exit status in early versions was always ignored), this flag defaults to 0.</p>
<p>If this flag is set and the Dump/Restore/Archive PreUserCmd fails then the matching Dump/Restore/Archive PostUserCmd is not executed. If DumpPreShareCmd returns a non-exit status, then DumpPostShareCmd is not executed, but the DumpPostUserCmd is still run (since DumpPreUserCmd must have previously succeeded).</p>
<p>An example of a DumpPreUserCmd that might fail is a script that snapshots or dumps a database which fails because of some database error.</p>
</dd>
<strong><dt id="_conf_clientnamealias_">$Conf{ClientNameAlias}</a> = undef;</dt></strong>
<dd>
<p>Override the client's host name. This allows multiple clients to all refer to the same physical host. This should only be set in the per-PC config file and is only used by BackupPC at the last moment prior to generating the command used to backup that machine (ie: the value of <a href="#_conf_clientnamealias_">$Conf{ClientNameAlias}</a> is invisible everywhere else in BackupPC). The setting can be a host name or IP address, eg:</p>
<pre><code> <a href="#_conf_clientnamealias_">$Conf{ClientNameAlias}</a> = 'realHostName';
<a href="#_conf_clientnamealias_">$Conf{ClientNameAlias}</a> = '192.1.1.15';</code></pre>
<p>will cause the relevant smb/tar/rsync backup/restore commands to be directed to realHostName, not the client name.</p>
<p>Note: this setting doesn't work for hosts with DHCP set to 1.</p>
</dd>
</dl>
<h2 id="Email-reminders-status-and-messages">Email reminders, status and messages</h2>
<dl>
<strong><dt id="_conf_sendmailpath_">$Conf{SendmailPath}</a> = '';</dt></strong>
<dd>
<p>Full path to the sendmail command. Security caution: normal users should not allowed to write to this file or directory.</p>
</dd>
<strong><dt id="_conf_emailnotifymindays_">$Conf{EMailNotifyMinDays}</a> = 2.5;</dt></strong>
<dd>
<p>Minimum period between consecutive emails to a single user. This tries to keep annoying email to users to a reasonable level. Email checks are done nightly, so this number is effectively rounded up (ie: 2.5 means a user will never receive email more than once every 3 days).</p>
</dd>
<strong><dt id="_conf_emailfromusername_">$Conf{EMailFromUserName}</a> = '';</dt></strong>
<dd>
<p>Name to use as the "from" name for email. Depending upon your mail handler this is either a plain name (eg: "admin") or a fully-qualified name (eg: "admin@mydomain.com").</p>
</dd>
<strong><dt id="_conf_emailadminusername_">$Conf{EMailAdminUserName}</a> = '';</dt></strong>
<dd>
<p>Destination address to an administrative user who will receive a nightly email with warnings and errors. If there are no warnings or errors then no email will be sent. Depending upon your mail handler this is either a plain name (eg: "admin") or a fully-qualified name (eg: "admin@mydomain.com").</p>
</dd>
<strong><dt id="_conf_emailuserdestdomain_">$Conf{EMailUserDestDomain}</a> = '';</dt></strong>
<dd>
<p>Destination domain name for email sent to users. By default this is empty, meaning email is sent to plain, unqualified addresses. Otherwise, set it to the destintation domain, eg:</p>
<pre><code> $Cong{EMailUserDestDomain} = '@mydomain.com';</code></pre>
<p>With this setting user email will be set to 'user@mydomain.com'.</p>
</dd>
<strong><dt id="_conf_emailnobackupeversubj_">$Conf{EMailNoBackupEverSubj}</a> = undef;</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_emailnobackupevermesg_">$Conf{EMailNoBackupEverMesg}</a> = undef;</dt></strong>
<dd>
<p>This subject and message is sent to a user if their PC has never been backed up.</p>
<p>These values are language-dependent. The default versions can be found in the language file (eg: lib/BackupPC/Lang/en.pm). If you need to change the message, copy it here and edit it, eg:</p>
<pre><code> <a href="#_conf_emailnobackupevermesg_">$Conf{EMailNoBackupEverMesg}</a> = <<'EOF';
To: $user$domain
cc:
Subject: $subj
Dear $userName,
This is a site-specific email message.
EOF</code></pre>
</dd>
<strong><dt id="_conf_emailnotifyoldbackupdays_">$Conf{EMailNotifyOldBackupDays}</a> = 7.0;</dt></strong>
<dd>
<p>How old the most recent backup has to be before notifying user. When there have been no backups in this number of days the user is sent an email.</p>
</dd>
<strong><dt id="_conf_emailnobackuprecentsubj_">$Conf{EMailNoBackupRecentSubj}</a> = undef;</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_emailnobackuprecentmesg_">$Conf{EMailNoBackupRecentMesg}</a> = undef;</dt></strong>
<dd>
<p>This subject and message is sent to a user if their PC has not recently been backed up (ie: more than <a href="#_conf_emailnotifyoldbackupdays_">$Conf{EMailNotifyOldBackupDays}</a> days ago).</p>
<p>These values are language-dependent. The default versions can be found in the language file (eg: lib/BackupPC/Lang/en.pm). If you need to change the message, copy it here and edit it, eg:</p>
<pre><code> <a href="#_conf_emailnobackuprecentmesg_">$Conf{EMailNoBackupRecentMesg}</a> = <<'EOF';
To: $user$domain
cc:
Subject: $subj
Dear $userName,
This is a site-specific email message.
EOF</code></pre>
</dd>
<strong><dt id="_conf_emailnotifyoldoutlookdays_">$Conf{EMailNotifyOldOutlookDays}</a> = 5.0;</dt></strong>
<dd>
<p>How old the most recent backup of Outlook files has to be before notifying user.</p>
</dd>
<strong><dt id="_conf_emailoutlookbackupsubj_">$Conf{EMailOutlookBackupSubj}</a> = undef;</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_emailoutlookbackupmesg_">$Conf{EMailOutlookBackupMesg}</a> = undef;</dt></strong>
<dd>
<p>This subject and message is sent to a user if their Outlook files have not recently been backed up (ie: more than <a href="#_conf_emailnotifyoldoutlookdays_">$Conf{EMailNotifyOldOutlookDays}</a> days ago).</p>
<p>These values are language-dependent. The default versions can be found in the language file (eg: lib/BackupPC/Lang/en.pm). If you need to change the message, copy it here and edit it, eg:</p>
<pre><code> <a href="#_conf_emailoutlookbackupmesg_">$Conf{EMailOutlookBackupMesg}</a> = <<'EOF';
To: $user$domain
cc:
Subject: $subj
Dear $userName,
This is a site-specific email message.
EOF</code></pre>
</dd>
<strong><dt id="_conf_emailheaders_">$Conf{EMailHeaders}</a> = <<EOF;</dt></strong>
<dd>
<p>Additional email headers. This sets to charset to utf8.</p>
</dd>
</dl>
<h2 id="CGI-user-interface-configuration-settings">CGI user interface configuration settings</h2>
<dl>
<strong><dt id="_conf_cgiadminusergroup_">$Conf{CgiAdminUserGroup}</a> = '';</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_cgiadminusers_">$Conf{CgiAdminUsers}</a> = '';</dt></strong>
<dd>
<p>Normal users can only access information specific to their host. They can start/stop/browse/restore backups.</p>
<p>Administrative users have full access to all hosts, plus overall status and log information.</p>
<p>The administrative users are the union of the unix/linux group <a href="#_conf_cgiadminusergroup_">$Conf{CgiAdminUserGroup}</a> and the manual list of users, separated by spaces, in <a href="#_conf_cgiadminusers_">$Conf{CgiAdminUsers}</a>. If you don't want a group or manual list of users set the corresponding configuration setting to undef or an empty string.</p>
<p>If you want every user to have admin privileges (careful!), set <a href="#_conf_cgiadminusers_">$Conf{CgiAdminUsers}</a> = '*'.</p>
<p>Examples:</p>
<pre><code> <a href="#_conf_cgiadminusergroup_">$Conf{CgiAdminUserGroup}</a> = 'admin';
<a href="#_conf_cgiadminusers_">$Conf{CgiAdminUsers}</a> = 'craig celia';
--> administrative users are the union of group admin, plus
craig and celia.
<a href="#_conf_cgiadminusergroup_">$Conf{CgiAdminUserGroup}</a> = '';
<a href="#_conf_cgiadminusers_">$Conf{CgiAdminUsers}</a> = 'craig celia';
--> administrative users are only craig and celia'.</code></pre>
</dd>
<strong><dt id="_conf_cgiurl_">$Conf{CgiURL}</a> = undef;</dt></strong>
<dd>
<p>URL of the BackupPC_Admin CGI script. Used for email messages.</p>
</dd>
<strong><dt id="_conf_language_">$Conf{Language}</a> = 'en';</dt></strong>
<dd>
<p>Language to use. See lib/BackupPC/Lang for the list of supported languages, which include English (en), French (fr), Spanish (es), German (de), Italian (it), Dutch (nl), Polish (pl), Portuguese Brazillian (pt_br) and Chinese (zh_CH).</p>
<p>Currently the Language setting applies to the CGI interface and email messages sent to users. Log files and other text are still in English.</p>
</dd>
<strong><dt id="_conf_cgiuserhomepagecheck_">$Conf{CgiUserHomePageCheck}</a> = '';</dt></strong>
<dd>
</dd>
<strong><dt id="_conf_cgiuserurlcreate_">$Conf{CgiUserUrlCreate}</a> = 'mailto:%s';</dt></strong>
<dd>
<p>User names that are rendered by the CGI interface can be turned into links into their home page or other information about the user. To set this up you need to create two sprintf() strings, that each contain a single '%s' that will be replaced by the user name. The default is a mailto: link.</p>
<p><a href="#_conf_cgiuserhomepagecheck_">$Conf{CgiUserHomePageCheck}</a> should be an absolute file path that is used to check (via "-f") that the user has a valid home page. Set this to undef or an empty string to turn off this check.</p>
<p><a href="#_conf_cgiuserurlcreate_">$Conf{CgiUserUrlCreate}</a> should be a full URL that points to the user's home page. Set this to undef or an empty string to turn off generation of URLs for user names.</p>
<p>Example:</p>
<pre><code> <a href="#_conf_cgiuserhomepagecheck_">$Conf{CgiUserHomePageCheck}</a> = '/var/www/html/users/%s.html';
<a href="#_conf_cgiuserurlcreate_">$Conf{CgiUserUrlCreate}</a> = 'http://myhost/users/%s.html';
--> if /var/www/html/users/craig.html exists, then 'craig' will
be rendered as a link to http://myhost/users/craig.html.</code></pre>
</dd>
<strong><dt id="_conf_cgidateformatmmdd_">$Conf{CgiDateFormatMMDD}</a> = 1;</dt></strong>
<dd>
<p>Date display format for CGI interface. A value of 1 uses US-style dates (MM/DD), a value of 2 uses full YYYY-MM-DD format, and zero for international dates (DD/MM).</p>
</dd>
<strong><dt id="_conf_cginavbaradminallhosts_">$Conf{CgiNavBarAdminAllHosts}</a> = 1;</dt></strong>
<dd>
<p>If set, the complete list of hosts appears in the left navigation bar pull-down for administrators. Otherwise, just the hosts for which the user is listed in the host file (as either the user or in moreUsers) are displayed.</p>
</dd>
<strong><dt id="_conf_cgisearchboxenable_">$Conf{CgiSearchBoxEnable}</a> = 1;</dt></strong>
<dd>
<p>Enable/disable the search box in the navigation bar.</p>
</dd>
<strong><dt id="_conf_cginavbarlinks_">$Conf{CgiNavBarLinks}</a> = [ ... ];</dt></strong>
<dd>
<p>Additional navigation bar links. These appear for both regular users and administrators. This is a list of hashes giving the link (URL) and the text (name) for the link. Specifying lname instead of name uses the language specific string (ie: $Lang->{lname}) instead of just literally displaying name.</p>
</dd>
<strong><dt id="_conf_cgistatushilightcolor_">$Conf{CgiStatusHilightColor}</a> = { ...</dt></strong>
<dd>
<p>Hilight colors based on status that are used in the PC summary page.</p>
</dd>
<strong><dt id="_conf_cgiheaders_">$Conf{CgiHeaders}</a> = '<meta http-equiv="pragma" content="no-cache">';</dt></strong>
<dd>
<p>Additional CGI header text.</p>
</dd>
<strong><dt id="_conf_cgiimagedir_">$Conf{CgiImageDir}</a> = '';</dt></strong>
<dd>
<p>Directory where images are stored. This directory should be below Apache's DocumentRoot. This value isn't used by BackupPC but is used by configure.pl when you upgrade BackupPC.</p>
<p>Example:</p>
<pre><code> <a href="#_conf_cgiimagedir_">$Conf{CgiImageDir}</a> = '/var/www/htdocs/BackupPC';</code></pre>
</dd>
<strong><dt id="_conf_cgiext2contenttype_">$Conf{CgiExt2ContentType}</a> = { };</dt></strong>
<dd>
<p>Additional mappings of file name extenions to Content-Type for individual file restore. See $Ext2ContentType in BackupPC_Admin for the default setting. You can add additional settings here, or override any default settings. Example:</p>
<pre><code> <a href="#_conf_cgiext2contenttype_">$Conf{CgiExt2ContentType}</a> = {
'pl' => 'text/plain',
};</code></pre>
</dd>
<strong><dt id="_conf_cgiimagedirurl_">$Conf{CgiImageDirURL}</a> = '';</dt></strong>
<dd>
<p>URL (without the leading http://host) for BackupPC's image directory. The CGI script uses this value to serve up image files.</p>
<p>Example:</p>
<pre><code> <a href="#_conf_cgiimagedirurl_">$Conf{CgiImageDirURL}</a> = '/BackupPC';</code></pre>
</dd>
<strong><dt id="_conf_cgicssfile_">$Conf{CgiCSSFile}</a> = 'BackupPC_stnd.css';</dt></strong>
<dd>
<p>CSS stylesheet "skin" for the CGI interface. It is stored in the <a href="#_conf_cgiimagedir_">$Conf{CgiImageDir}</a> directory and accessed via the <a href="#_conf_cgiimagedirurl_">$Conf{CgiImageDirURL}</a> URL.</p>
<p>For BackupPC v3.x several color, layout and font changes were made. The previous v2.x version is available as BackupPC_stnd_orig.css, so if you prefer the old skin, change this to BackupPC_stnd_orig.css.</p>
</dd>
<strong><dt id="_conf_cgiuserconfigeditenable_">$Conf{CgiUserConfigEditEnable}</a> = 1;</dt></strong>
<dd>
<p>Whether the user is allowed to edit their per-PC config.</p>
</dd>
<strong><dt id="_conf_cgiuserconfigedit_">$Conf{CgiUserConfigEdit}</a> = { ...</dt></strong>
<dd>
<p>Which per-host config variables a non-admin user is allowed to edit. Admin users can edit all per-host config variables, even if disabled in this list.</p>
<p>SECURITY WARNING: Do not let users edit any of the Cmd config variables! That's because a user could set a Cmd to a shell script of their choice and it will be run as the BackupPC user. That script could do all sorts of bad things.</p>
</dd>
</dl>
<hr />
<h1 id="Version-Numbers">Version Numbers</h1>
<p>Starting with v1.4.0 BackupPC uses a X.Y.Z version numbering system, instead of X.0Y. The first digit is for major new releases, the middle digit is for significant feature releases and improvements (most of the releases have been in this category), and the last digit is for bug fixes. You should think of the old 1.00, 1.01, 1.02 and 1.03 as 1.0.0, 1.1.0, 1.2.0 and 1.3.0.</p>
<p>Additionally, patches might be made available. A patched version number is of the form X.Y.ZplN (eg: 2.1.0pl2), where N is the patch level.</p>
<hr />
<h1 id="Author">Author</h1>
<p>Craig Barratt <cbarratt@users.sourceforge.net></p>
<p>See <a href="http://backuppc.sourceforge.net">http://backuppc.sourceforge.net</a>.</p>
<hr />
<h1 id="Copyright">Copyright</h1>
<p>Copyright (C) 2001-2015 Craig Barratt</p>
<hr />
<h1 id="Credits">Credits</h1>
<p>Ryan Kucera contributed the directory navigation code and images for v1.5.0. He contributed the first skeleton of BackupPC_restore. He also added a significant revision to the CGI interface, including CSS tags, in v2.1.0, and designed the BackupPC logo.</p>
<p>Xavier Nicollet, with additions from Guillaume Filion, added the internationalization (i18n) support to the CGI interface for v2.0.0. Xavier provided the French translation fr.pm, with additions from Guillaume.</p>
<p>Guillaume Filion wrote BackupPC_zipCreate and added the CGI support for zip download, in addition to some CGI cleanup, for v1.5.0. Guillaume continues to support fr.pm updates for each new version.</p>
<p>Josh Marshall implemented the Archive feature in v2.1.0.</p>
<p>Ludovic Drolez supports the BackupPC Debian package.</p>
<p>Javier Gonzalez provided the Spanish translation, es.pm for v2.0.0.</p>
<p>Manfred Herrmann provided the German translation, de.pm for v2.0.0. Manfred continues to support de.pm updates for each new version, together with some help from Ralph Paßgang.</p>
<p>Lorenzo Cappelletti provided the Italian translation, it.pm for v2.1.0. Giuseppe Iuculano and Vittorio Macchi updated it for 3.0.0.</p>
<p>Lieven Bridts provided the Dutch translation, nl.pm, for v2.1.0, with some tweaks from Guus Houtzager, and updates for 3.0.0.</p>
<p>Reginaldo Ferreira provided the Portuguese Brazillian translation pt_br.pm for v2.2.0.</p>
<p>Rich Duzenbury provided the RSS feed option to the CGI interface.</p>
<p>Jono Woodhouse from CapeSoft Software (www.capesoft.com) provided a new CSS skin for 3.0.0 with several layout improvements. Sean Cameron (also from CapeSoft) designed new and more compact file icons for 3.0.0.</p>
<p>Youlin Feng provided the Chinese translation for 3.1.0.</p>
<p>Karol 'Semper' Stelmaczonek provided the Polish translation for 3.1.0.</p>
<p>Jeremy Tietsort provided the host summary table sorting feature for 3.1.0.</p>
<p>Paul Mantz contributed the ftp Xfer method for 3.2.0.</p>
<p>Petr Pokorny provided the Czech translation for 3.2.1.</p>
<p>Rikiya Yamamoto provided the Japanese translation for 3.3.0.</p>
<p>Yakim provided the Ukrainian translation for 3.3.0.</p>
<p>Sergei Butakov provided the Russian translation for 3.3.0.</p>
<p>Many people have reported bugs, made useful suggestions and helped with testing; see the ChangeLog and the mailing lists.</p>
<p>Your name could appear here in the next version!</p>
<hr />
<h1 id="License">License</h1>
<p>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</p>
<p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>
<p>You should have received a copy of the GNU General Public License in the LICENSE file along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.</p>
<table border="0" width="100%" cellspacing="0" cellpadding="3">
<tr><td class="_podblock_" style="background-color: #cccccc" valign="middle">
<big><strong><span class="_podblock_"> BackupPC</span></strong></big>
</td></tr>
</table>
</body>
</html>
|