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 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link href="style.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>DAR - Frequently Asked Questions</title>
</head>
<body>
<a name="top"> </a>
<div class=top>
<img alt="Dar Documentation" src="dar_s_doc.jpg" style="float:left;">
<h1>DAR's - Frequently Asked Questions</h1>
</div>
<h2>Questions:</h2>
<div class=jump>
<div class=menuitem>
<a href="#top">Back to top</a>
</div>
</div>
<div class=menutop>
<div class=menuitem>
<a href="#A1">
I restore/save all files but dar reported some files have been ignored,
what are those ignored files?
</a><br/>
<a href="#A2">Dar hangs when using it with pipes, why?</a><br/>
<a href="#A3">Why, when I restore 1 file, dar report 3 files have been restored?</a><br/>
<a href="#libattr">While compiling dar I get the following message :
<code>g++: /lib/libattr.a: No such file or directory</code>, what can I do?</a><br/>
<a href="#A4">I cannot find the binary package for my distro, where to look for?</a><br/>
<a href="#A6">
Can I use different filters between a full backup and a
differential backup? Would not dar consider some file not included in
the filter to be deleted?
</a><br/>
<a href="#A7">
Once in action dar
makes all the system slower and slower, then it stops with the message
"killed"! How to overcome this problem?
</a><br/>
<a href="#A8">I have a backup I want to change the size of slices?</a><br/>
<a href="#A9">
I have a backup in one slice, how can I split it in several
slices?
</a><br/>
<a href="#A10">
I have a backup in several slice, how can I stick all them
in a single file?
</a><br/>
<a href="#A11">I have a backup, how can I change its encryption scheme?</a><br/>
<a href="#A12">I have a backup, how can I change its compression algorithm?</a><br/>
<a href="#A13">Which options can I use with which options?</a><br/>
<a href="#A14">Why dar reports corruption for the backup I have transfered with FTP?</a><br/>
<a href="#UIDGID">Why DAR does save UID/GID instead of plain usernames and usergroups?</a><br/>
<a href="#Dar_Manager_encrypted">Dar_Manager does not accept encrypted backups, how to workaround this?</a><br/>
<a href="#staticOSX">How to overcome the lack of static linking on MacOS X?</a><br/>
<a href="#single_slice">Why cannot I test, extract file, list the contents of a given slice from a backup?</a><br/>
<a href="#merge_two_isolated">Why cannot I merge two isolated catalogues?</a><br/>
<a href="#parallel">How to use the full power of my multi-processor computer?</a><br/>
<a href="#threadsafe">Is libdar thread-safe, which way do you mean it is?</a><br/>
<a href="#How_to_solve_configure:_error:_Cannot">How to solve <code>configure: error: Cannot find size_t type</code>"?</a><br/>
<a href="#slow_2_4_0">Why dar became much slower since release 2.4.0?</a><br/>
<a href="#slow_2_5_0">Why dar became yet slower since release 2.5.0?</a><br/>
<a href="#search_for_questions">How to search for questions (and their answers) about known problems similar to mines?</a><br/>
<a href="#open_failed_excluded">Why dar tells me that he failed to open a directory, while I have excluded this directory?</a><br/>
<a href="#security">Dar reports a <code>SECURITY WARNING! SUSPICIOUS FILE</code> what does that mean!?</a><br/>
<a href="#copy">Can dar help copy a large directory tree?</a><br/>
<a href="#compression">Does dar compress per file or the whole backup?</a><br/>
<a href="#sizes">What slice size can I use with dar?</a><br/>
<a href="#fuse">Is there a dar fuse filesystem?</a><br/>
<a href="#tar">how dar compares to tar or rsync?</a><br/>
<a href="#diff">Why when comparing a backup with filesystem, dar does not report new files found on filesystem?</a><br/>
<a href="#delta">Why dar does not automatically perform delta difference (aka rsync increment)?</a><br/>
<a href="#cyrillic">Why do dar reports truncated filenames under Windows, especially with cyrillic filenames?</a><br/>
<a href="#win32">I have a 32 bits windows system, which binary package can I to use?</a><br/>
<a href="#windows_slash">Path slash and back-slash consideration under Windows</a><br/>
<a href="#windows_root">Under Windows, which directory corresponds to /</a><br/>
<a href="#windows_home">Under Windows, which directory corresponds to $HOME?</a><br>
<a href="#windows_scripting">Under Windows, how to have working -E or -F options?</a><br>
<a href="#lzop_vs_dar">lzo compression is slower with dar than with lzop, why?</a><br/>
<a href="#libthreadar">what is libthreadar and why libdar relies on it?</a><br/>
<a href="#sftppubkey">I have sftp pubkey authentication working with ssh/sftp, how to have dar using too this public key authentication for sftp?</a><br/>
<a href="#libssh2">I Cannot get dar to connect to remote server using SFTP, it fails with "<code>SSL peer certificate or SSH remote key was not OK</code>"</a><br/>
<a href="#too_large"><code>Cannot open catalogue: Cannot handle such a too large integer.</code> What to do?</a><br/>
<a href="#sftppubkey">I have sftp pubkey authentication working with ssh/sftp, how to have dar using too this public key authentication for sftp?</a><br/>
<a href="#full-from-diff">I have a diff/incremental backup and I want to convert it to a full backup, how to do that?</a><br/>
<a href="#tapes">How to use dar with tapes (like LTO tapes)?</a><br/>
<a href="#Smallfiles">Why dar does not compress small files toghether for better compression ratio?</a><br/>
<a href="#truncated">What to do when a backup was interrupted?</a><br/>
</div>
</div>
<div class=maintop>
<h2>Answers:</h2>
<a name="A1"><b>I restore/save all files but dar reported some files have been ignored, what are those ignored files?</b></a><br/>
<p>
When restoring/saving, all files are considered by default. But if you specify some files to restore or
save, all other files are "ignored", this is the case when using -P -X
-I, -g -[ or -] options
</p>
<a name="A2" id="A2"><b>Dar hangs when using it with pipes, why?</b></a><br/>
<p>
Dar can produce backups on its
standard output, if you give '-' as
basename. But it cannot read a backup from its standard input in
direct access mode. To
feed a backup to dar through pipes, you either need <code>dar_slave</code> and two pipes
or use the sequential mode (<code>--sequential-mode</code> option, which gives
slow restoration of a few files compared to the (default) direct access mode).
To use dar with dar_slave over pipes in direct access mode (which is
the more efficient way to proceed), see the <a href="usage_notes.html#dar_remote">detailed notes</a> or more
precisely <a href="usage_notes.html#netcat_ssh">dar and ssh note</a>.
</p>
<a name="A3" id="A3"><b>Why, when I restore 1 file, dar report 3 files have been restored?</b></a><br/>
<p>
if you restore for example the file usr/bin/emacs dar will first
restore usr (if the directory already exists, it will get its date and
ownership restored, all existing files in that directory will however stay
preserved), then
/usr/bin will be restored, and last usr/bin/emacs will be restored.
Thus 3 inodes have been
restored or modified while only one file has been asked for restoration.
</p>
<a name="libattr"><b>While compiling dar I get the following message: <code>g++: /lib/libattr.a: No such file or directory</code>, what can I do?</b></a><br/>
<p>
The problem comes from an
incoherence in your distro (Redhat and Slackware seem(ed) concerned at
least): Dar (Libtool) finds
<code>/usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../libattr.la</code>
file to link with. This file defines where is located libattr static and
dynamic libraries but in this file both static and dynamic libraries
are expected to be found under /lib. While the dynamic libattr is
there, the static version has been moved to /usr/lib. A
workaround is to make a symbolic link:
</p>
<code class=block>
ln -s /usr/lib/libattr.a /lib/libattr.a
</code>
<br/>
<a name="A4" id="A4"><b>I cannot find the binary package for my distro, where to look for?</b></a><br/>
<p>
For any
binary package, ask
your distro maintainer to include dar (if
not already done), and check on the web site of your preferred distro
for a dar package
</p>
<a name="A6" id="A6"><b>Can I use different filters between a full backup and a
differential backup? Would not dar consider some file not included in
the filter to be deleted?</b></a><br/>
<p>
Yes, you
can. No, there is no
risk to have dar deleting the files that
were not selected for the differential backup. Here is the way dar
works:
</p>
<p>During a
backup process, when a
file is ignored due to filter
exclusion, an "ignored" entry is added to the catalogue. At the
end of the backup, dar compares both catalogues, the one of reference
and the new one built during the backup process, and adds a "detruit" entry
(which means "destroyed" in French), when an entry of the reference is not
present in the new catalogue. Thus, if an "ignored" is present no
"detruit" will be added for that name. Then all "ignored" entries are
removed and the catalogue is written at the end of the backup or archive.
</p>
<a name="A7" id="A7"><b>Once in action, dar makes all the system slower and slower, then it stops with the message
"killed"! How to overcome this problem?</b></a><br/>
<p>
Dar needs
virtual memory to
work. Virtual memory is the RAM + SWAP
space. Dar memory requirement grows with the amount of file saved, not
with the amount of data saved. If you have a few huge files you will
have little chance to see any memory limitation problem. At the
opposite, saving a plethora of files (either big or small), will make
dar request an increasing amount of virtual memory. Dar needs this memory to build the
<i>catalogue</i> (the contents) of the backup it creates. Same thing, for
differential backup, except it also needs to load in memory the
<i>catalogue</i> of the backup of reference, which most of the time will make
dar using twice more memory when doing a differential backup than a
full backup.
<p/>
<p>
Anyway, the
solution is:
</p>
<ol>
<li>Read the <a href="Limitations.html">limitatons file</a> to
understand the problem and
be
aware of the limitations you will bring at step 3, bellow.
</li>
<li>If you can, add swap space to your system (under Linux, you
can either add a swap partition or a swap file, which is less constraining
but also a bit less efficient). Bob Barry provided a script that can
give you a raw estimation of the required virtual memory
(<a href="samples/index.html">doc/samples/dar_rqck.bash</a>), it was
working well with dar 2.2.x but since then and the newly added features, the
amount of metadata per file is variable: The memory requirement per file also depends
on the presence and amount of Extended Attributes and Filesystem specific attributes,
which changes from file to file.
</li>
<li>
If this is not enough, or if you don't want/cannot add swap
space, recompile dar giving --enable-mode=64 argument to the configure script.
Note that since release 2.6.x this is the default compilation mode, thus you should
be good now.
</li>
<li>
If this is not enough, and you have some money, you can add
some RAM on you system
</li>
<li>If all that fails, ask for support on the
<a href="https://lists.sourceforge.net/lists/listinfo/dar-support">dar-support mailing-list</a>.
</li>
</ol>
<p>
Last, there is always the workaround to make several smaller backups
of the files to save. For example, making a backup for all that is in
/usr/local, another one for all that is in /var and so on. These backups can be full
or differential. The drawback is not big as you can store these
backups side by side and use them at will. Moreover, you can feed a
unique dar_manager database with all these different backups
which will hide you the fact that there are several full and
several differential backups concerning different set of files.
</p>
<a name="A8" id="A8"><b>I have a backup I want to change the size of slices?</b></a><br/>
<p>
<code>dar_xform</code> is your friend!
</p>
<code class=block>
dar_xform -s <size> original_backup new_backup
</code>
<p><code>dar_xform</code>
will create a new backup file with the slices of the requested
size, (you can also make use of -S option for the first slice). Note
that you don't need to decrypt the backup, not dar will uncompress it,
this is thus a very fast processing. See <a href="man/index.html">dar_xform
man page</a> for more.
</p>
<a name="A9" id="A9"><b>I have a backup in one slice, how can I split it in several slices?</b></a><br/>
<p>
<code>dar_xform</code> is your friend!
</p>
<p>
see just above.
</p>
<a name="A10" id="A10"><b>I have a backup in several slice, how can I stick all them in a single file?</b></a><br/>
<p>
<code>dar_xform</code> is your friend!
</p>
<code class=block>
dar_xform original_backup new_backup
</code>
<p>
dar_xform without <code>-s</code> option creates a single sliced backup.
See <a href="man/index.html">dar_xform man page</a> for more.
</p>
<a name="A11" id="A11"><b>I have a backup, how can I change its encryption scheme?</b></a><br/>
<p>
The merging feature let you do
that. The merging has two roles, putting
in one backup the contents of two different backups, and at the same time
filtering out some files you decided not to include into the resulting
backup. The merging feature can take two but also only one backup as
input. This is what we will use and without any filter to keep all saved files.
<p>
<ul>
<li>a single input (our original backup)</li>
<li>no file filtering (so we keep all the files)</li>
<li>
keeping files compressed (no decompression/re compression) to
speed up the process (<code>-ak</code> option)
</li>
</ul>
<code class=block>
dar -+ new_backup -A original_backup -K "<new_algo>:new pass" -ak
</code>
<p>
If you don't want to have password in
clear on the command line (command that can be seen for example with <i>top</i>
or <i>ps</i> by other users), simply provide
<code>"<algo>:"</code> then dar will ask you on the fly for the password. If using
blowfish you can then just provide <code>":"</code>
for the keys. Note that before release 2.5.0, -J option was needed to provide
the password of the source backup. Since then, without -J option, dar will ask interactively
for the password of the backup to read. You can still use -J
option to provide the password from a DCF file and this way avoid dar interactively asking for it.
</p>
<p>
Note that you can also change slicing of the backup at the same time
thanks to -s and -S options:
</p>
<code class=block>
dar -+ new_backup -A original_backup -K ":" -ak -s 1G
</code>
<br/>
<a name="A12" id="A12"><b>I have a backup, how can I change its compression algorithm?</b></a><br/>
<p>
Same thing as above: we will use the merging feature:
</p>
<p>
to use bzip2 compression:
</p>
<code class=block>
dar -+ new_backup -A original_backup -zbzip2
</code>
<p>
to use gzip compression
</p>
<code class=block>
dar -+ new_backup -A original_backup -zgzip
</code>
<p>
to use lzo compression, use <code>-zlzo</code>, for LZ4 use
<code>-zlz4</code>, for zstd use <code>-lzstd</code> and so on.
</p>
<p>
To use no compression at all, do no add any -z option or exclude all files from compression (<code>-Z "*"</code>):
</p>
<code class=block>
dar -+ new_backup -A original_backup
</code>
<br/>
<p>
Note that you can also change encryption scheme and slicing at the same
time you change compression:
</p>
<code class=block>
dar -+ new_backup -A original_backup -zbzip2 -K ":" -J ":" -s 1G
</code>
<br/>
<a name="A13"><b>Which options can I use with which options?</b></a><br/>
<p>
DAR provides seven commands:
</p>
<dl>
<dd><code>-c</code> to create a new backup</dd>
<dd><code>-x</code> to extract files from a given backup</dd>
<dd><code>-l</code> to list the contents of a given backup</dd>
<dd><code>-d</code> to compare the contents of a backup with filesystem</dd>
<dd><code>-t</code> to test the internal coherence of a given backup</dd>
<dd><code>-C</code> to isolate a backup (extract its contents to a usually small file) or make a snapshot of the current filesystem</dd>
<dd><code>-+</code> to merge two backups in one or create a sub
backup from one or two other ones</dd>
<dd><code>-y</code> to repair a backup</dd>
</dl>
<p>
For each command listed above, here follows the available options (those marked OK):
</p>
<div class=table>
<table class=center>
<tr>
<th>short option</th>
<th>long option</th>
<th>-c</th>
<th>-x</th>
<th>-l</th>
<th>-d</th>
<th>-t</th>
<th>-C</th>
<th>-+</th>
<th>-y</th>
</tr>
<tr>
<td>-v</td>
<td>--verbose</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-vs</td>
<td>--verbose=s</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-b</td>
<td>--beep</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-n</td>
<td>--no-overwrite</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-w</td>
<td>--no-warn</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-wa</td>
<td>--no-warn=all</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-A</td>
<td>--ref</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-R</td>
<td>--fs-root</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-X</td>
<td>--exclude</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-I</td>
<td>--include</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-P</td>
<td>--prune</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-g</td>
<td>--go-into</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-]</td>
<td>--exclude-from-file</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-[</td>
<td>--include-from-file</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-u</td>
<td>--exclude-ea</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-U</td>
<td>--include-ea</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-i</td>
<td>--input</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-o</td>
<td>--output</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-O</td>
<td>--comparison-field</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-H</td>
<td>--hour</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-E</td>
<td>--execute</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-F</td>
<td>--ref-execute</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-K</td>
<td>--key</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-J</td>
<td>--ref-key</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-#</td>
<td>--crypto-block</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-*</td>
<td>--ref-crypto-block</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-B</td>
<td>--batch</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-N</td>
<td>--noconf</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-e</td>
<td>--empty</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-aSI</td>
<td>--alter=SI</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-abinary</td>
<td>--alter=binary</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-Q</td>
<td></td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-aa</td>
<td>--alter=atime</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-ac</td>
<td>--alter=ctime</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-am</td>
<td>--alter=mask</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-an</td>
<td>--alter=no-case</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-acase</td>
<td>--alter=case</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-ar</td>
<td>--alter=regex</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-ag</td>
<td>--alter=glob</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-z</td>
<td>--compression</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-s</td>
<td>--slice</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-S</td>
<td>--first-slice</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-p</td>
<td>--pause</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-@</td>
<td>--aux</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-$</td>
<td>--aux-key</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-~</td>
<td>--aux-execute</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-%</td>
<td>--aux-crypto-block</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-D</td>
<td>--empty-dir</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-Z</td>
<td>--exclude-compression</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-Y</td>
<td>--include-compression</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-m</td>
<td>--mincompr</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-ak</td>
<td>--alter=keep-compressed</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-af</td>
<td>--alter=fixed-date</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td></td>
<td>--nodump</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-M</td>
<td>--no-mount-points</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-,</td>
<td>--cache-directory-tagging</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-k</td>
<td>--deleted</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-r</td>
<td>--recent</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-f</td>
<td>--flat</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-ae</td>
<td>--alter=erase_ea</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-T</td>
<td>--list-format</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-as</td>
<td>--alter=saved</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-ad</td>
<td>--alter=decremental</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-q</td>
<td>--quiet</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-/</td>
<td>--overwriting-policy</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-<</td>
<td>--backup-hook-include</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-></td>
<td>--backup-hook-exclude</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-=</td>
<td>--backup-hook-execute</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-ai</td>
<td>--alter=ignore-unknown-inode-type</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-at</td>
<td>--alter=tape-marks</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-0</td>
<td>--sequential-read</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-;</td>
<td>--min-digits</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-1</td>
<td>--sparse-file-min-size</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-ah</td>
<td>--alter=hole-recheck</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-^</td>
<td>--slice-mode</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-_</td>
<td>--retry-on-change</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-asecu</td>
<td>--alter=secu</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-.</td>
<td>--user-comment</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-3</td>
<td>--hash</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-2</td>
<td>--dirty-behavior</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-al</td>
<td>--alter=lax</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
</tr>
<tr>
<td>-alist-ea</td>
<td>--alter=list-ea</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-4</td>
<td>--fsa-scope</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-5</td>
<td>--exclude-by-ra</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-7</td>
<td>--sign</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-'</td>
<td>--modified-data-detection</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-{</td>
<td>--include-delta-sig</td>
<td>OK</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-}</td>
<td>--exclude-delta-sig</td>
<td>OK</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-8</td>
<td>--delta</td>
<td>OK</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-6</td>
<td>--delta-sig-min-size</td>
<td>OK</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-az</td>
<td>--alter=zeroing-negative-dates</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-\</td>
<td>--ignored-as-symlink</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>-T</td>
<td>--kdf-param</td>
<td>OK</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
</tr>
<tr>
<td>--aduc</td>
<td>--alter=duc</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-G</td>
<td>--multi-thread</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td>-j</td>
<td>--network-retry-delay</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-afile-auth</td>
<td>--alter=file-authentication</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-ab</td>
<td>--alter=blind-to-signatures</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>OK</td>
<td>--</td>
</tr>
<tr>
<td>-aheader</td>
<td>--alter=header</td>
<td>--</td>
<td>--</td>
<td>OK</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
</table>
</div>
<br/>
<a name="A14"><b>Why dar reports corruption of the backup I have transfered with FTP?</b></a><br/>
<p>
Dar backups
are binary files,
they must be transfered in
binary mode
when using FTP. This is done in the following way for the ftp
command-line client :
</p>
<code class=block>
ftp <somewhere>
<login>
<password>
<e>bin</e>
put <file>
get <file>
bye
</code>
<p>
If you transfer a backup (or
any other binary file) in ascii mode (the opposite of binary mode), the
8th bit of each byte will be lost and the backup will become
impossible to recover (due to the destruction of this information). Be
very careful to test your backup after transferring back to you host
to be sure you can delete the original file.
</p>
<a name="UIDGID"><b> Why DAR does save UID/GID
instead of plain usernames and usergroups?</b></a><br/>
<p>In each file property is
not present the name of the owner nor the name of the group owner, but
instead are present two numbers, the user ID and the group ID (UID
& GID in short). The /etc/password file associates to these numbers
a names and some other properties (like the login shell, the
home directory, the password, see also /etc/shadow).
Thus, when you do a directory list (with the 'ls' command for example
or with any GUI program for another example), the listing application
used
does open each directory, there it finds a list of name and a inode
number associated, then the listing program fetchs the inode attributes
for each file and looks among other information for the UID and the
GID. To be able
to display the real user name and group name, the listing application
use a well-defined standard C library call that will do the lookup in
/etc/password, eventually NIS system if configured and any other
additional
system, [this way applications have not to bother with the many system
configuration possible, the same API interface is used whatever is the
system], then lookup returns the name if it exist and the listing
application displays for each
file found in a directory the attributes and the user name and group
name as returned by the system instead of the UID and GID.
</p>
<p>
As you can see, the user name and
group name are not part of any file attribute, but UID and GID *are*
instead. Dar is a backup tool mainly, it does preserve as much as
possible the file properties to be able to restore them as close as
possible
to their original state. Thus a file saved with UID=3 will be restored
with UID=3. The name corresponding the UID 3 may exist or not,
may exist and be the same or may exist and be different, the file will
be anyway restored in UID 3.
</p>
<p><u>Scenario with dar's way of restoring</u></p>
<p>
Thus, when doing backup and
restoration of a crashed system you can be confident, the restoration
will not interfere with the bootable system you have used to launch dar
to restore your disk. Assuming you have UID 1 labeled <i>'bin'</i> in your
real crashed system, but this UID 1 is labeled <i>'admin'</i> in the boot
system, while UID 2 is labeled <i>'bin'</i>
in this boot system, files owned
by <i>bin</i> in the system to
restore will be restored under UID 1, not UID 2
which is used by the temporary boot system. At that time after
restoration still running the from the boot system, if you do a 'ls'
you will see that the original files
owned by <i>'bin'</i> are now owned
by user <i>'admin'.</i>
</p>
<p>
This is really a mirage: in your restoration you will also restore the <i>/etc/password</i>
file and other system configuration files (like NIS configuration files if they have
been used), then at reboot time on the newly restored real system, the UID 1 will
be backed associated to user <i>'bin'</i>
as expected and files originally owned by user <i>bin</i> will now been listed as owned
by <i>bin</i> as expected.
</p>
<p><u>Scenario with plain name way of restoring</u></p>
<p>
If dar had done else, restoring
the files owned by <i>'bin'</i> to
the UID corresponding to <i>'bin',</i>
these files would have been given UID 2 (the one used by the temporary
bootable system used to launch dar). But once the real restored system
would have been launched, this UID 2 would have become some other user and
not <i>'bin'</i> which is mapped to
UID 1 in the restored <i>/etc/password.</i>
</p>
<p>
Now, if you want to change some
UID/GID when moving a set of files from
one live system to another system, there is no problem if you are <i>not</i>
restoring dar under the <i>'root'</i>
account. Other account than <i>'root'</i> are
usually not allowed to modify UID/GID, thus restored files by dar will
have group and user ownership of the dar process, which is the one that
has launched dar.
</p>
<p>
But if you really need to move a
directory tree containing a set of files with different ownership and
you want to preserve these different ownership from one live system to
another, while the corresponding UID/GID do not match between the two
system, dar can still help you:
</p>
<ul>
<li>Save your directory tree on the source live system</li>
<li>
From the root account in the destination live system do the
following:
</li>
<li>restore the backup content in a empty directory</li>
<li>
change the UID of files according to the one used by the
destination filesystem with the command:
<code class=block>
find /path/to/restored/backup -uid <old UID> -print -exec chown <new name> {} \;
find /path/to/restored/backup -gid <old GID> -print -exec chgrp <new name> {} \;
</code>
The first command will let you
remap an UID to another for all files
under the /path/to/restored/backup directory<br/>
The second command will let you remap a GID to another for all files
under the /path/to/restored/backup directory
</li>
</ul>
<u>Example on how to globally modify ownership of a directory tree user by user</u><br/>
<p>
For example, you have on the <i>source</i> system three users: Pierre
(UID 100), Paul (UID 101), Jacques (UID 102)
but on the <i>destination</i> system,
these same users are mapped to
different UID: Pierre has UID 101, Paul has UID 102 and Jacques has UID 100.
</p>
<p>
We temporary need an unused UID on the destination system, we will
assume UID 680 is not used. Then after the backup restoration in the
directory /tmp/A we will do the following:
</p>
<code class=block>
find /tmp/A -uid 100 -print -exec chown 680 {} \;
find /tmp/A -uid 101 -print -exec chown pierre {} \;
find /tmp/A -uid 102 -print -exec chown paul {} \;
find /tmp/A -uid 680 -print -exec chown jacques {} \;
</code>
<p>
which is:
</p>
<ul>
<li>
change files of UID 100 to UID 680 (the files of Jacques are now under
the temporary UID 680 and UID 100 is now freed)
</li>
<li>
change files of UID 101 to UID 100 (the files of Pierre get their UID
of the destination live system, UID 101 is now freed)
</li>
<li>
change files of UID 102 to UID 101 (the files of Paul get their UID of
the destination live system, UID 102 is now freed)
</li>
<li>
change files of UID 680 to UID 102 (the files of Jacques which had been
temporarily moved to UID 680 are now set to their UID on the
destination live system, UID 680 is no more used).
</li>
</ul>
<p>
You can then move the modified
files to appropriated destination or
make a new dar backup to be restored in appropriated place if you want
to use some of dar's feature like for example only restore files that
are more recent than those present on filesystem.
</p>
<a name="Dar_Manager_encrypted"><b>Dar_Manager does not accept encrypted backups, how to workaround this?</b></a><br/>
<p>
Yes, that's true, dar_manager
does not accept encrypted backups. The
first reason is that while dar_manager database cannot be encrypted
this is not very fair to add to them encrypted backups. The second
reason is because the dar_manager database should hold the key for each
encrypted backup making this backup the weakest point in your data
security: Breaking the database encryption would then provide
access to any encryption key, and with original backup access it would
bring access to data of any of the backup added to the database.
<p>
To workaround this, you can proceed as follows:
</p>
<ul>
<li>
isolate your encrypted backup into an unencrypted 'isolated
catalogue': Do not use the -K option while isolating.
Without -J option dar will prompt for the password of the encrypted
archive. For automated process, you are encouraged to use
a DCF file with restricted permissions and
containing the '-J <key>' option to be passed for dar. The instruct
dar to read that file thanks to -B option.
</li>
<li>
add these extracted catalogue to the dar_manager database
of your choice,
</li>
<li>
change the name and path of the added catalogue to point to
your real encrypted backups (-b and -p options of dar_manager).</li>
</ul>
<p>
Note that as the database is not
encrypted this will expose the backup
file listing (not the file's contents) of your encrypted backups to
anyone able to read the database, thus it is recommended to set
restrictive permission to this database file.
</p>
<p>
When will come the time to use dar_manager to restore some file, you
will have to make dar_manager pass the key to dar for it be able to
restore the needed files from the backup. This can be done in several
ways: dar_manager's command-line, dar_manager database or dar.dcf file.
</p>
<ol>
<li>
dar_manager's command-line: simply pass the -e "-K
<key>" to dar_manager . Note that this will expose the key twice:
on dar_manager's command-line and on dar's command-line.
</li>
<li>
dar_manager database: the database can store some constant
command to be passed to dar. This is done using the -o option, or the
-i option. The -o option exposes the arguments you want to be passed to
dar because they are on dar_manager command-line. While the -i option,
let you do the same thing but in an interactive manner, this is a
better choice.
</li>
<li>
A better way is to use a DCF file with restrictive
permission. This one will receive the '-K <key>' option for dar
to be able to read the encrypted backups. And dar_manager will ask dar
to read this file thanks to the '-B <filename>' option you will
have given either on dar_manager's command-line (-e -B <filename>
...) or from the stored option in the database (-o -B <filename>).
</li>
<li>
The best way is let dar_manager pass the -K option to dar,
but without password : simply passing the -e "-K :" option to
dar_manager. When dar will get the -K option with the ":" argument, it
will dynamically ask for the password and store it in a secured memory.
</li>
</ol>
<a name="staticOSX"><b>How to overcome the lack of static linking on MacOS X?</b></a><br/>
<p>
The answer comes from Dave
Vasilevsky in an email to the dar-support
mailing-list. I let him explain how to do:
</p>
<div style="font-style:italic; margin-left:25px;">
<p>
Pure-static
executables aren't used on OS X.
However, Mac OS X does have other ways to build portable binaries.
HOWTO build portable binaries on OS X?
</p>
<p>
First, you have to make sure
that dar only uses operating-system
libraries that exist on the oldest version of OS X that you care about.
You do this by specifying one of Apple's SDKs, for example:
</p>
<code class=block>
export CPPFLAGS="-isysroot /Developer/SDKs/MacOSX10.2.8.sdk"
export LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.2.8.sdk"
</code>
<p>
Second, you have to make sure
that any non-system libraries that dar
links to are linked in statically. To do this edit
dar/src/dar_suite/Makefile, changing LDADD to
'../libdar/.libs/libdar.a'. If any other non-system
libs are used (such as gettext), change the
makefiles so they are also linked in
statically. Apple should really give us a way to force the linker to do this
automatically!
</p>
<p>
Some caveats:
</p>
<ul>
<li>If you build for 10.3 or
lower, you will not get EA support, and
therefore you will not be able to save special Mac information like
resource forks.
</li>
<li>
To work on both ppc and x86
Macs, you need to build a universal
binary. For instructions, use Google -)
</li>
<li>
To make a 10.2-compatible
binary, you must build with GCC 3.3.
</li>
<li>
These instructions won't work
for the 10.1 SDK, that one is harder to
use.
</li>
</ul>
</div>
<a name="single_slice"><b>Why cannot I test, extract file, list the contents of a given slice from a backup?</b></a><br/>
<p>
Well this is due to dar's design. However you can list a whole backup and see
in which slice(s) a file is located:
</p>
<code class=block>
<b># dar -l test <e>-Tslice</e> -g etc/passwd</b>
<e>Slice(s)</e>|[Data ][D][ EA ][FSA][Compr][S]|Permission| Filemane
--------+--------------------------------+----------+-----------------------------
<e>1</e> [Saved][-] [-L-][ 69%][ ] drwxr-xr-x etc
<e>2</e> [Saved][ ] [-L-][ 63%][ ] -rw-r--r-- etc/passwd
-----
All displayed files have their data in slice range [1-2]
-----
<b>#</b>
</code>
<br/>
<a name="merge_two_isolated"><b>Why cannot I merge two isolated catalogues?</b></a><br/>
<p>
Since version 2.4.0, isolated catalogues can also be used to rescue an
corrupted internal catalogue of the backup it has been isolated from.
For that feature be possible, a mecanism let dar know if an given
isolated catalogue and a given backup correspond to the same contents.
Merging two isolated catalogues would break this feature as the
resulting backup would not match any real backup an could only be
used as reference for a differential backup.
</p>
<a name="parallel"><b>How to use the full power of my multi-processor computer?</b></a><br/>
<p>
Since release 2.7.0 it is possible to have dar efficiently using many threads at two independent levels:
</p>
<dl>
<dt class=void>encryption</dt><dd>
You can specify the number of thread to use to cipher/decipher a backup. Note however
that during tests done for 2.7.0 validation, it was observed that having more
than two threads for encryption does not gives better results than using only two threads
when compression is used, because most of the time compression is more CPU intensive
than encryption (well all depends on the chosen algorithms, that's right).
</dd>
<dt class=void>compression</dt><dd>
Before release 2.7.0 compression was done per file in streaming mode. In this
mode to compress data you need to know the result of the compression of the data that
is located before it, this brings good compression ratio but is impossible to
parallelize. To be able to compress in parallel one need to split data in block,
and compress blocks independently. There you can use a lot of threads up to the time
when this is the disk I/O that is the slowest process. Adding more compression
thread will not change the result. The drawback of compressing per thread is less
the compression ratio that is slightly less good than in stream compression mode, than
the memory requirement to hold a data block of clear data per thread and the compressed
resulting data, times the number of threads. To avoid having any thread waiting for
disk I/O, you even have to store a bit more memory block than the number of threads,
this is managed by libdar.
</dd>
</dl>
<p>
To activate multi-threading with dar, use the <code>-G</code> option, read the dar man page
for all details about the way to define the number of encryption thread and the number of
compression thread, as well as the compression block size to use.
</p>
<a name="threadsafe"><b>Is libdar thread-safe, which way do you mean it is?</b></a><br/>
<p>
libdar is the part of dar's
source code that has been rewritten to be used by external programs
(like kdar). It has been modified to be used in a multi-threaded
environment, thus, <b>*yes*, libdar is thread-safe</b>.
However, thread-safe does not mean that you do not have to take some
precautions in your programs while using libdar (or any other library).
</p>
<p>
Care must thus be taken for two different threads
<b>not acting on the same variables/objects at the same time</b>.
This is however possible with the use of posix mutex, which would
define a portion of code (known as a critical section) that cannot be
entered by more than one thread at a time.
</p>
<p>
A few objects provided by libdar API supports the concurrent access
from several threads, read the API documentation for more.
</p>
<a name="How_to_solve_configure:_error:_Cannot"><b>How to solve
<code>configure: error: Cannot find size_t type</code>?</b></a><br/>
<p>
This error shows when you lack support for C++ compilation. Check the
gcc compiler has been compiled with C++ support activated, or if you
are using gcc binary from a distro, double check you have installed the
C++ support for gcc.
</p>
<a name="slow_2_4_0"><b>Why dar became much slower since release 2.4.0?</b></a><br/>
<p>
This is the drawback of new features!
</p>
<ul>
<li>
Especially to be able to read dar backup through pipes in
sequential mode, dar inserts so-called "escape sequence" (also referred as
tape mark) to know
for example when a new file starts. This way dar can skip to the next
mark upon backup corruption or if the given file has not to be
restored. However, if such a sequence of byte is found into a file's
data, it must be modified not to collide with real escape sequences.
This leads dar to inspect all data added to a backup for
such sequence of byte, instead of just copying the data to the backup
(eventually compressing and cyphering it).
</li>
<li>
The other feature that brings an important overhead is the
sparse file detection mechanism. To be able to detect a hole in a file
and store it into the backup, dar needs here too, to inspect each
file's data.
</li>
</ul>
<p>
You can disable both of these features, using respectively the options <code><b>-at</b></code>
option, which suppress "tape marks" (just another name for escape
sequences), but does not allow the generated backup to be used in
sequential read mode, and <b><code>-1 0</b></code>
option, which completely disables the sparse file detection. The
execution time becomes back the same as the one of dar 2.3.x releases.
</p>
<a name="slow_2_5_0"><b>Why dar became yet slower since release 2.5.0?</b></a><br/>
<p>
This is again the drawback of new features!
</p>
<ul>
<li>
The first feature that drain time is <b>Filesystem Specific Attributes (FSA)</b>,
as it requires new system calls for each new files to save. This has
little impact when saving a lot of big files but become visible when
saving a lot a tiny files or directories.
</li>
<li>
The second feature is the use of <b>fadvise()</b>
system call that preserves
cache usage. In other words dar tells the system it does not need
anymore a file when it has been read (backup) or written (restoration)
this has the advantage to reduce cache presure from dar to the benefit
of other running process needs. The idea here is to preserves as much
as possible a live operating system from being affected by a running
backup relying on dar. The consequence is that if running dar a second
time on the same set of file, with dar 2.4.x and below the data to save
was most of the time in the cache which could lead to very fast
execution, while with dar 2.5.x the data to save may have been flushed
out of the cache by more important data for another application. This
second time dar is run, the data has to be read again from disk which
does not bring the same very fast execution as reading from cache.
</li>
</ul>
<p>
You can disable both of these features. The first can be disabled <b>at compilation time</b>
giving <code><b>--disable-fadvise</b></code> to the <code>./configure</code> script.
The second option can be disabled at any time by adding the
<code><b>--fsa-scope=none</b></code> option to <code>dar</code>.
The execution time becomes back then the same as the one of dar 2.4.x releases.
</p>
<a name="search_for_questions"><b>How to search for questions (and their answers) about known problems similar to mines?</b></a><br/>
<p>
Have a look a the <a href="https://sourceforge.net/p/dar/mailman/search/?mail_list=dar-support">dar-support mailing-list archive</a>
and if you cannot find any answer to your problem feel free to send an email to this mailing-list describing your problem/need.
</p>
<a name="open_failed_excluded"><b>Why dar tells me that he failed to open a directory, while I have excluded this directory?</b></a><br/>
<p>
Reading the contents of a
directory is done using the usual system call
(opendir/readdir/closedir). The first call (opendir) let dar design
which directory to inspect, the dar call readdir to get the next entry
in the opened directory. Once nothing has to be read, closedir is
called. The problem here is that dar cannot start reading a directory
do some treatment and start reading another directory. In brief, the
opendir/readdir/closedir system call are not re-entrant.
</p>
<p>
This is in particular critical for dar as it does a depth lookup in the
directory tree. In other words, from the root if we have two
directories A and B, dar reads A's contents, the contents of its
subdirectories, then once finished, it read the next entry of the root
directory (which is B), then read the contents of B and then of each of
its subdirectories, then once finished for B, it must go back to the
root again, and read the next entry. In the meanwhile dar had to open
many directories to get their contents.
</p>
<p>
For this reason dar caches the directory contents (when it first meet a
directory, it read its whole content and stores it in the RAM). This is
only after, that dar decide whether to include or not a given
directory. But at this point then, its contents has already been read
thus you may get the message that dar failed to read a given directory
contents, while you explicitly specify not to include that particular
directory in the backup.
</p>
<a name="security"><b>Dar reports a
<code>SECURITY WARNING! SUSPICIOUS FILE</code> what does that mean!?</b>
</a><br/>
<p>
When dar reports the following message:
</p>
<code class=block>
SECURITY WARNING! SUSPICIOUS FILE <filepath>: ctime changed since backup of reference was done, while no inode or data changed
</code>
<p>
You should be concerned by finding an explanation to the root cause
that triggered dar to ring this alarm. As you probably know, a unix
file has three (sometimes four) dates:
</p>
<ol>
<li><b>atime</b> is changed
anytime you read the file's contents or write to it (this is the last <b>a</b>ccess time)
</li>
<li><b>mtime</b> is changed
anytime you write to the file's data (this is the last <b>m</b>odification time)
</li>
<li><b>ctime</b> is changed
anythime ou modify the file's attributes (the is the last <b>c</b>hange time)
</li>
<li><b>btime</b> is never changed once a file has been created (this is the <b>b</b>irth time or creation time),
not all filesystem do provide it.
</ol>
<p>
In other words:
</p>
<ul>
<li>if you only read the data of file, only its <b>atime</b> will be updated<sup>1</sup></li>
<li>if you write some data to a file, its <b>ctime</b> and <b>mtime</b> will change, atime will stay unchanged</li>
<li>if you change ownership, permission, extended attributes, etc. only <b>ctime</b> will change</li>
<li>if you write to a file and modify its atime or mtime to let think the file has not been read or modified, <b>ctime</b> will change in any case.</li>
</ul>
<p>
Yes, the point is that in most (if not all) unix systems, over the
kernel itself, user program can also manually set the atime
and mtime manually to any arbitrary value
(see the "touch" command for example), but to my knowledge, no system
provides a mean to manually set the ctime of a file. This value cannot
thus be faked.
</p>
<p>
However, some rootkits and other nasty programs that tend to hide
themselves from the system administrator use this trick and modify the
mtime to become more difficult to detect. Thus, the ctime keeps track
of the date and time of their infamy. However, ctime may also change
while neither mtime nor atime do, in several almost rare but normal
situations. Thus, if you are faced to this message, you should first verify the
following points before thinking your system has been infected by a
rootkit:
</p>
<ul>
<li>
have you added or removed a hardlink pointing to that file
and this file's data has not been modified since last backup?
</li>
<li>
have you changed this file's extended attributs (including Linux ACL and
MacOS file forks) while file's data has not been modified since last
backup?
</li>
<li>
have you recently restored your data and are now performing
a differential backup taking as reference the backup used to restore
that same data? Or in other words, does that particular file has just
been restored from a backup (was removed by accident for example)?
</li>
<li>
have you just moved from a dar version older than release
2.4.0 to dar version 2.4.0 or more recent?
</li>
<li>
have you upgraded the package this file is part of since
last backup?
</li>
</ul>
<p>
How to know atime/mtime/ctime of a file?
</p>
<ul>
<li>mtime is provided by the command: <code>ls -l</code></li>
<li>atime is provided by the command : <code>ls -l --time=atime</code></li>
<li>ctime is provided by the command : <code>ls -l --time=ctime</code></li>
<li>the <code>stat</code> command provides all dates of a given file: <code>stat <filename></code></li>
</ul>
<dl>
<dt class=void>Note:</dt>
<dd>
With dar
version older than 2.4.0 (by default, unless -aa option is use) once a
file has been read for backup, dar set back the atime to the value it
had before dar read it. This trick was used to accomodate some programs
like leafnode (NNTP caching program) that base their cache purging
scheme on the atime of files. When you do a backup using dar 2.3.11 for
example, file that had their mtime modified are saved as expected and
their atime is set back to their original values (value they had just
before dar read them), which has the slide effect to modify the ctime.
If then you upgrade to dar 2.4.0 or more recent and do a differential
backup, if that same file has not been modified since, dar will see
that the ctime has changed while no other metadata did (user,
ownership, group, mtime), thus this alarm message will show for all
saved files in the last 2.3.11 backup made. The next differential
backup made using dar 2.4.0 (or more recent), the problem will not show
anymore.
</dd>
</dl>
<p>
Well, if you cannot find an valid explanation from the one presented
above, you'd better consider that your system has been infected by a
rootkit or a virus and use all the necessary tools (see below for
examples) to find some evidence of it.
</p>
<ul>
<li><a href="http://rkhunter.sourceforge.net/">Rootkit Hunter</a></li>
<li><a href="http://www.unhide-forensics.info/">Unhide</a></li>
<li><a href="http://www.clamav.net/lang/en/">clam anti-virus</a></li>
<li>and others...</li>
</ul>
<p>
Last point, if you can explain the cause of the alarm and are annoyed
by it (you have hundred of files concerned for example) <b>you can
disable this feature</b> adding the <code><b>-asecu</b></code>
switch to the command-line.
</p>
<p>
<b><sup>1</sup></b> atime may also not be updated at all if filesystem
is mounted with relatime or noatime option.
</p>
<a name="copy"><b>Can dar help copy a large directory tree?</b></a><br/>
<p>
The answer is "yes" and even for more than one reason:
</p>
<ol>
<li>
Many backup/copy tools do not take care of hard linked
inode (hard linked plain files, named pipes, char devices, block
devices, symlinks)... dar does,
</li>
<li>
Many backup/copy tools do not take care of sparse files... dar does,
</li>
<li>
Many backup/copy tools do not take care of Extended Attributes... dar does,
</li>
<li>Many backup/copy tools do not take care of Posix ACL
(Linux)... dar does,
</li>
<li>Many backup/copy tools do not take care of file forks
(MacOS X)... dar does,
</li>
<li>Many backup/copy tools do not take any precautions while
working on a live system... dar does.
</li>
</ol>
<p>
Using the following command will
do the trick without relying on temporary file or backup:
</p>
<code class=block>
dar -c - -R <srcdir> --retry-on-change 3 -N | dar -x - --sequential-read -N -R <dstdir>
</code>
<p>
<code><srcdir></code> contents will be copied to <code><dstdir></code>
both must exist before running this command, and <code><dstdir></code>
should be an empty dir.
</p>
<p>
Here is an example: we will copy the content of /home/my to /home2/my.
first we create the destination directory, then we run <code>dar</code>
</p>
<code class=block>
mkdir /home2/my
dar -c - -R /home/my --retry-on-change 3 | dar -x - --sequential-read -R /home2/my
</code>
<p>
The <code>--retry-on-change</code> let dar
retry the copy of a file up to three times if that file has changed at
the time dar was reading it. You can increase this number at will. If a
file fails to be copied correctly after more than the allowed retry, a
warning is issued about that file and it is flagged as dirty in the
data flow, the second dar command will then ask you whether you want it
to be restored (here copied) on not.
</p>
<p>
"piping" ('|' shell syntax) the first dar's output to the second dar's
input makes the operation not requiering any temporary storage, only
virtual memory is used to perform this copy. Compression is thus not
requested as it would only slow down the whole process.
</p>
<p>
<b>last point,</b> you
should compare the copied data to the original one, before removing it,
as no backup file has been dropped down to filesystem. This can simply
be done using:
<code class=block>
diff -r <srcdir> <dstdir>
</code>
<p>
But, no, diff will not check extended Attributes, File Forks or Posix
ACL, hard linked inodes, etc. If you want a more controlable way of
copying a large directory, simply use dar with a real backup file,
compare the backup toward the original filesystem, restore the backup
contents to its new place, and compare the restored filesystem toward
the original backup.
</p>
<p>
Any better idea? Feel free to contact dar's author for an update of
this documentation!
</p>
<a name="compression"><b>Does dar compress per file or the whole backup?</b></a><br/>
<p>
Dar uses compression (gzip, lzo, bzip2, xz/lzma, zstd, lz4, ...) with different level of
compression (1 for quick but
low compression up to 9 for best
compression but slower execution) on <u>a file by file basis</u>.
I other words, the compression engine is reset for each new file added
into the backup. When a corruption occurs in a
file like a compressed <i>tar</i>
backup, it is not possible to decompress the data passed
that corruption, with tar you loose all files stored after such data
corruption.
</p>
<p>
Having compression per file has instead the <u>advantage</u>
to only impact one file inside the backup and all files that are
stored before or after such data corruption can still be restored from
that corrupted backup. Compressing per file opens the possibility to
not compress all files in the
backup, in particular already compressed files (like *.jpeg, *.mpeg, some *.avi
files and of course the *.gz, *.bz2 or *.lzo files). Avoiding
compressing already compressed files save CPU cycles (in other words
it speeds up backup process time). And while compressing an already
compressed file takes time for nothing, it also leads to require more storage space
than if that same file was not compressed a second tim
</p>
<p>
The <u>drawback</u> is that the
overall compression ratio is slightly less good.
</p>
<p>
How to activate compression with dar? Use the
<code><b>--compression</b></code>
option (or -z in short), telling the algorithm to use and the
compression level (--compression=bzip2:9 or -zgip:7 for example), you
may not mention the compression ratio (which default to 9) and even not
mention the compression algorithm which default to gzip. Thus -z or
-zlzo are correct.
</p>
<p>
To select file to compress or not compress, several options are
available: <code><b>--exclude-compression</b></code>
(or -Z in short --- the uppercase Z here) <code><b>--include-compression</b></code>
(or -Y in short). Both take as argument a mask that based on their
names define files that have to be compressed or not to be compressed. For
example <code>-Z "*.avi" -Z "*.mp?" -Z "*.mpeg"</code> will avoid compressing MPEG,
MP3, MP2 and AVI files. Note that dar provides in its <code>/etc/darrc</code>
default configuration file, a long list of -Z options to avoid compressing
most common compressed files, that you can activate by simply adding
<code><b>compress-exclusion</b></code> on dar command-line.
</p>
<p>
In addition to excluding/including files from compression based on
their name, you can also exclude small files (for which compression
ratio is usually poor) using the <code><b>--mincompr</b></code>
option which takes a size as argument: <code>--mincompr 1k</code> will avoid compressing
files which size is less than or equal to 1024 bytes. You should find
all details about these options in <a href="man/dar.html">dar man page</a>.
Check also the <code>-am</code> and <code>-ar</code> options to
understand how <code>--exclude-compression</code>and
<code>--include-compression</code> interact with
each other, or how to use <i>regular expression</i>s in place of
<i>glob expressions</i> in masks.
</p>
<a name="sizes"><b>What slice size can I use with dar?</b></a><br/>
<p>
The <b>minimum slice size is around 20 bytes</b>,
but you will only be able to store 3 to 4 bytes of information per
slice, due to the slice header that need around 15 bytes in each slice (this vary
depending on options used and may increase in future backup version
format). <b>But there is no maximum slice size!</b>
In other words you can give to <code>-s</code> and <code>-S</code> options
an as long as required positive integer, thanks to its internal own
integer type named "<i>infinint</i>"
dar is able to handle arbitrarily large
integers (file offset, file size, etc.).
</p>
<P>
You can make use of suffixes like 'k' for kilo, M for mega, G for giga
etc... (<a href="usage_notes.html#bytes_bits_kilo">all suffixes are
listed here</a>) to simplify your work. See also
the <code>-aSI </code>and <code>-abinary</code> options to swap meaning
between ko (= 1000 octets) kio (= 1024 octets).
</p>
<p>
Last point dar/libdar can be compiled using the --enable-mode=64 option
given to ./configure while building dar (this is the default since release 2.6.0).
This replaces the "infinint" type by 64 bits integers, for better performances and reduced memory usage.
However this has some drawback on backup size and dates. See the <a href="Limitations.html">limitations</a> for more details.<br/>
Since release 2.6.0 the default being the 64 bits mode, to have dar/libdar using <i>infinint</i>
one need to use the following option <code>./configure --enable-mode=infinint</code>.
</p>
<a name="fuse"><b>Is there a dar <a href="http://fuse.sourceforge.net/">fuse</a> filesystem?</b></a><br/>
<p>
You can find several applications
relying on dar or directly on libdar
to manage dar backup, these are referred here as <a href="presentation.html#external_tools">external software</a>
because they are not maintained nor have been created by the author of
dar and libdar. <a href="http://www.boomerangsworld.de/cms/avfs/extfs?lang=en">AVFS</a>
is such external software that provides a virtual file system layer for
transparently accessing the content
of backups and remote directories just like local files.
</p>
<a name="tar"><b>how dar compares to tar or rsync</b></a><br/>
<p>
All depends on the use case you want to address. A <a href="benchmark.html">benchmark</a> has
been setup to match the performances, features and behaviors or <i>dar</i>, <i>rsync</i> and <i>tar</i> in
regard to a set of common use cases. Hopefully this will help you answer this question.
</p>
<a name="diff"><b>Why when comparing a backup with filesystem, dar does not report new files found on filesystem?</b></a><br/>
<p>
Backup comparison (<code>-d</code> option) is
to be seen as a step further than
backup testing (<code>-t</code> option) where dar checks the backup internal
structure and usability. The step further here is not only to check
that each part of the backup is readable and has a correct associated
CRC but also that it matches what is present on filesystem. So yes, if
new files are present on filesystem, nothing has to be reported. If a
file changed, dar reports that the file does not match what's in the
backup, if a file is missing dar cannot compare it with filesystem
and reports an error too.
</p>
<p>
So you want to know what has changed on your filesystem?
No problem, <b>do a differential backup!</b>
OK, you don't want to have a new backup or do not have the space for
that, just output the backup to /dev/null and request on-fly isolation
as follows:
</p>
<code class=block>
dar -c - -A <ref backup> -@ <isolated> ... other options ... > /dev/null<br/>
</code>
<p>
<dl>
<dt class=void><code><ref backup></code></dt>
<dd>is the backup of reference or an isolated
catalogue
</dd>
<dt class=void><code><isolated></code></dt>
<dd>
is the name of the isolated
catalogue to produce.
</dd>
</dl>
<p>
Once the operation has completed, you can list
the isolated catalogue using the following command:
</p>
<code class=block>
dar -l <isolated> -as
</code>
<p>
It will give you the exact difference between your current filesystem
and the filesystem at the time the <code><ref backup></code> was done:
modified files and new files are reported with <code>[inref]</code> for either data EA or both,
while deleted files are reported by <code>[--- REMOVED ENTRY ----]</code>
information, followed by the estimated removal date and the type of the
removed file (<code>[-]</code> for plain file, <code>[d]</code> for directory, and so on. More
details in dar man page for listing command).
</p>
<a name="delta"><b>Why dar does not automatically perform delta difference (aka rsync increment)?</b></a><br/>
<p>
Because delta different is subject in theory to checksum collision (but it is very
unprobable though), which could lead a new version of a file being seen
the same as an older one while some changes took place in it. A second
reason is to take care of users preference, that do not want
having this feature activated by default. Well, now, activating delta
difference with dar is quite simple and flexible, see <a href="usage_notes.html#delta">note</a>.<br/>
</p>
<a name="cyrillic"><b>Why do dar reports truncated filenames under Windows, especially with cyrillic filenames?</b></a><br/>
<p>
Dar/libdar has been first
developer for Linux. It has been later ported to many other operating
systems. For Unix-like system (FreeBSD, Solaris, ...), it can run as a
native program by just recompiled it for the target OS and processor.
For Windows system, it cannot because Unix and Windows systems do not
provide the same system calls at all. The easiest way to have dar
running under Windows was to rely on Cygwin, which translates the Unix
system calls to Windows system calls. However Cygwin brings some
limitations. One of them is that it cannot provide filenames longer
than 256 bytes, while today's Windows can have much longer filenames.
</p>
<p>
What the point with cyrillic filenames? Cyrillic characters unlike most
latin ones are not stored as a single byte, they usually use several
bytes per character, thus this maximum file size is reached much
quicker than with latin filenames, but the problem also exists with
them.
</p>
<p>
The consequence is that when dar reads a directory that contains a
large filename, the Cygwin layer is not able to provide it entierly:
the filename is truncated. When dar wants to read information about
that filename most of the time such truncated filename does not exists
and dar reports the message from the system that this file does not
exists (which might sound strange from user point of view). Since
release 2.5.4 dar reports instead that filename has been truncated and
that it will be ignored.
</p>
<a name="win32"><b>I have a 32 bits windows system, which binary package can I to use?</b></a><br/>
<p>
Up to release 2.4.15 (including)
the dar/libdar binaries for windows were built on a 32 bits windows
(XP) system. After that release, binaries for windows have been built
using a 64 bits windows system (7, now 8 and probably 10 soon).
Unfortunately, the filename of the binary packages for windows do not
reflect that change and have still been labeled "i386" while included
binaries do no more supporting i386 CPU family (which are 32 bits CPU).
This is an oversight that has been unseen until Adrian Buciuman's
remark in dar-support mailing-list September 23d, 2016. In consequence
after that date binary packages for windows will receive an additional
field corresponding to the windows flavor they have been built against.
</p>
<p>
Some may still need 32 bits windows binaries of dar, unfortunately I
have no more access to such system, but if you have such windows ISO
image and valid license to give me, I could install it into a virtual
machine and provide binary packages for 32 bits too.
</p>
<p>
Until then, you can build yourself the binary for windows. Here follows the recipe:
</p>
<p>
install <a href="https://www.cygwin.com/">Cygwin</a> on windows including at least the following packages:
</p>
<ul>
<li>clang C/C++ compiler</li>
<li>cygwin devel</li>
<li>doxygen</li>
<li>gettext-devel</li>
<li>liblzo2-devel</li>
<li>libzzip-devel</li>
<li>libgpgme-devel</li>
<li>librsync-devel (starting future release 2.6.0)</li>
<li>make</li>
<li>tcsh</li>
<li>zip<br/>
</li>
<li>upx</li>
</ul>
<p>
Then get the dar source code and extract its content (either using windows native tools or using tar under cygwin)
For clarity let's assuming you have extracted dar source package for version x.y.z
into <code>C:\Temp</code> directory, thus you now have the directory <code>C:\Temp\dar-x.y.z</code>
</p>
<p>
Run a cygwin terminal and "cd" into that directory:
</p>
<code class=block>
cd /cygdrive/c/Temp/dar-x.y.z
</code>
<p>
In the previous command, note that from within a cygwin shell, the path
use slashes not windows backslashes ; note also the 'c' is lowercase
while windows shows upper case letter for drives...
</p>
<p>
But don't worry, we are almost finished, run the following script:
</p>
<code class=block>
misc/batch_cygwin x.y.z
</code>
<p>
starting release 2.5.7 the syntax will change / has changed
</p>
<code class=block>
misc/batch_cygwin x.y.z win32
</code>
<p>
the new "win32" or "win64" field will be used to label the zip package
containing the dar/libdar binary for windows, that's up to you to
choose the value corresponding to your OS 32/64 bits flavor.
</p>
<p>
At the end of the process you will get a dar zip file for windows in
<code>C:\Temp\dar-x.y.z</code> directory.
</p>
<p>
Feel free to ask for support on
<a href="https://lists.sourceforge.net/lists/listinfo/dar-support">dar-support mailing-list</a>
if you enconter any problem building dar binary for windows, this FAQ will be updated accordingly.
</p>
<a name="windows_slash"><b>Path slash and back-slash consideration under Windows</b></a><br/>
<p>
The paths given to dar's arguments and options
must respect the UNIX way (use slashes "/" not back
slashes "\" as it ought to be under Windows)
thus for example you have to have to use <code>/temp</code>
in place of <code>\temp</code>
</p>
<p>
Moreover, drive letters cannot be used the usual way, like
<code><e>c:\</e>windows\system32</code>. Instead you will have to
give the following path <code><e>/cygdrive/c/</e>windows/system32</code>.
As you see the <code>/cygdrive</code> directory is a
virtual directory that has all the drives as children directories:
</p>
<p>
Here is a more global example:
</p>
<code class=block>
c:\dar_win-1.2.1\dar -c /cygdrive/f/tmp/toto -s 2G -z1 -R "/cygdrive/c/My Documents"
^ ^ ^ ^ ^
| | | | |
--------------- ---------------------------
here use anti-slash but here we use slash
as usually under in arguments given to dar
windows to point
the command
</code>
<a name="windows_root"><b>Under Windows, which directory corresponds to /</b></a><br/>
<p>
When running <i>dar</i> from a windows command-line (thus not from cygwin environement), dar's root directory
is the parent directory of the one holding the <i>dar.exe</i> file. This does not mean that you cannot have dar
backing up anything outside this directory (you can thanks to the <code>/cygdrive/...</code> path alias seen above),
but when dar looks for <code>darrc</code> it looks using this parent directory as the "/" root one.
</p>
<p>
Since release 2.6.14, the published dar packages for Windows are configured and built
in such a way that <i>dar.exe</i> uses the provided <code>darrc</code> file located in the <code>etc</code>
sub-directory. So <code>darrc</code> is now usable, out of the box.
However if you rename the directory where <i>dar.exe</i> is located, which name is something like
<code>dar64-x.y.z-win64</code>, the <i>dar.exe</i> binary will still look for a <code>darrc</code> at
<code>/dar64-x.y.z-win64/etc/darrc</code>, taking as root directory the parent directory
of the directory where it resides. You can still then explicitely rely on it by mean of a -B option
pointing to the modified path where the <code>darrc</code> is located.
</p>
<a name="windows_home"><b>Under Windows, which directory corresponds to $HOME?</b></a><br/>
<p>
There is no such HOME variable in windows by default, however John Slattery on dar-support mailing-list
reported that if you set such variable in the command-line prompt dar will look for its .darrc at the
path pointed to by this HOME variable. For example:
</p>
<code class=block>
> set HOME=/cygdrive/c/users/john
or
> set HOME=c:\users\john
> cd c:\program files\dar64-2.7.14-win64
> .\dar.exe ....
</code>
<br/>
<a name="windows_scripting"><b>Under Windows, how to have working -E or -F options?</b></a><br/>
<p>
When calling a script from dar by mean of -E (same thing with -F or -~ options) you may end with this
obscure failure:
</p>
<code class=block>
Error during user command line execution: execve() failed. (process table is full ?) . Retry command-line ? [return = YES | Esc = NO]
</code>
<p>
RSmain at github has found the following solution:
</p>
<code class=block>
In fact, you need at least this folder structure with sh.exe and additional Cygwin libraries to run a simple "echo test" user command without errors:
<DAR main dir>\bin\<all DAR for Windows files>
<DAR main dir>\bin\sh.exe
<DAR main dir>\bin\cygreadline7.dll
<DAR main dir>\bin\cygncursesw-10.dll
<DAR main dir>\tmp
It appears that e.g. a "sleep" would also require sleep.exe from Cygwin, so I tend to integrate all files from Cygwin's bin directory with my DAR install.
</code>
<p>
Starting release 2.7.19 the dar packaging for Windows will integrate this folder structure, but you will still have to add your scripts and all commands they
rely on, in this <code><DAR main dir>\bin</code> directory.
</p>
<a name="lzop_vs_dar"><b>lzo compression is slower with dar than with lzop, why?</b></a><br/>
<p>
when using the "lzo" compression algorithm, <i>dar/libdar</i> always uses the algorithm
<i>lzo1x_999</i> with the compression level requested
(from 1 to 9) as argument. Dar thus provides 9 different
compression/speed levels with lzo.
</p>
<p>
In the other hand, as of today (2017) <i>lzop</i>, the command line tool,
uses the very degradated lzo algorithm known as <i>lzo1x_1_15</i>
for level 1 and the intermediate <i>lzo1x_1</i> algorithm
for levels from 2 to 6, which makes levels 2 to 6
totally equivalent from the <i>lzop</i> program point of view.
Last, compression levels 7 to 9 for <i>lzop</i> uses the same <i>lzo1x_999</i>
algorithm as what dar/libdar uses, which is the only algorithm of the lzo family
that makes use of a compression levels. In total lzop only provides 5 different
compression levels/algorithms only.
</p>
<p>
So now, you know why dar is slower than lzop when using lzo compression at level 1 to 6.
To get to equivalent feature as <i>lzop</i> provides for level 1 and 2-6, dar/libdar
provides two additional lzo-based compression algorithms: <code><b>lzop-1</b></code>
and <code><b>lzop-3</b></code>. As
you guess, <code>lzop-1</code> uses the <i>lzo1x_1_15</i> algorithm as lzop does for
its compression level 1, and <code>lzop-3</code> uses the <i>lzo1x_1</i> algorithm as lzop does
for its compression levels 2 to 6. For both lzop-1 and lzop-3 algorithms,
the compression level is not used, you can keep the default or change its value this
will not change dar behavior.
</p>
<div class=table>
<table class=center>
<tr>
<th>compression level<br/>for lzop</th>
<th>algorithm for dar</th>
<th>compression level<br/>for dar</th>
<th>lzo algorith used</th>
</tr>
<tr>
<td>1</td>
<td>lzop-1<br/>
</td>
<td>-<br/>
</td>
<td>lzo1x_1_15<br/>
</td>
</tr>
<tr>
<td>2<br/>
</td>
<td>lzop-3<br/>
</td>
<td>-<br/>
</td>
<td>lzo1x_1<br/>
</td>
</tr>
<tr>
<td>3<br/>
</td>
<td>lzop-3</td>
<td>-<br/>
</td>
<td>lzo1x_1</td>
</tr>
<tr>
<td>4<br/>
</td>
<td>lzop-3</td>
<td>-<br/>
</td>
<td>lzo1x_1</td>
</tr>
<tr>
<td>5<br/>
</td>
<td>lzop-3</td>
<td>-<br/>
</td>
<td>lzo1x_1</td>
</tr>
<tr>
<td>6<br/>
</td>
<td>lzop-3</td>
<td>-<br/>
</td>
<td>lzo1x_1</td>
</tr>
<tr>
<td>-<br/>
</td>
<td>lzo<br/>
</td>
<td>1<br/>
</td>
<td>lzo1x_999</td>
</tr>
<tr>
<td>-<br/>
</td>
<td>lzo<br/>
</td>
<td>2<br/>
</td>
<td>lzo1x_999</td>
</tr>
<tr>
<td>-<br/>
</td>
<td>lzo<br/>
</td>
<td>3<br/>
</td>
<td>lzo1x_999</td>
</tr>
<tr>
<td>-<br/>
</td>
<td>lzo<br/>
</td>
<td>4<br/>
</td>
<td>lzo1x_999</td>
</tr>
<tr>
<td>-<br/>
</td>
<td>lzo<br/>
</td>
<td>5<br/>
</td>
<td>lzo1x_999</td>
</tr>
<tr>
<td>-<br/>
</td>
<td>lzo<br/>
</td>
<td>6<br/>
</td>
<td>lzo1x_999</td>
</tr>
<tr>
<td>7<br/>
</td>
<td>lzo<br/>
</td>
<td>7<br/>
</td>
<td>lzo1x_999</td>
</tr>
<tr>
<td>8<br/>
</td>
<td>lzo<br/>
</td>
<td>8<br/>
</td>
<td>lzo1x_999</td>
</tr>
<tr>
<td>9<br/>
</td>
<td>lzo<br/>
</td>
<td>9<br/>
</td>
<td>lzo1x_999</td>
</tr>
</table>
</div>
<br/>
<a name="libthreadar"><b>What is libthreadar and why libdar relies on it?</b></a><br/>
<p>
libthreadar is a wrapping library of the Posix C threads. It was originally part of
<a href="https://sourceforge.net/projects/webdar/">webdar</a>
a libdar based web server project, but as this code became necessary
also inside libdar, all this thread relative classes have been put into
a separated library called libthreadar, that today both webdar and
libdar rely upon.
</p>
<p>
dar/libdar rely on libthreadar to manage several threads inside libdar,
which is necessary to efficiently implement the remote repository
feature based on libcurl (available starting release 2.6.0).
</p>
<p>
<u>Why not using boost library or the thread suppport brought by C++11?</u>
</p>
Because first no complier implemented C++11 at the time webdar was
started and second boost thread was not found to be adapted to the need
for the following reasons:
</p>
<ul>
<li>
I wanted a more object oriented approach than passing a
function to be ran into a separated thread as provided by boost/C++11
interface, where from the pure virtual class libthreadar::thread that
let you create inherited class from.
</li>
<li>
I wanted to avoid functions/methods with multiple
parameters, as it has shown in the past with libdar to be a source of
problem when it comes to backward compatibily while adding new
features. Instead the inherited class can provide as many different
methods to setup individual parameters before the thread is run()
</li>
<li>
As a consequence, another need was to be able to set an
object before the thread is effectively run, the C++ object existence
need not to match the thread existence, in other words the object shall
be created first and the thread run() afterward. Of course the
destruction of a thread object would kill the thread it is wrapping.
The other advantage doing that way was the possibility to re-run() a
thread from the same object once a first thread had completed
eventually modifying some parameters through the method provided by the
inherited class from libthreadar::thread
</li>
<li>
Last but not least, I wanted to have an exception thrown
from within a thread and not caught up to the global thread function
(thus leading the thread to end), to be kept over the thread existance
and relaunched into the thread calling the join() method for that
object. Thus avoiding having a coherent treatment of errors using C++
exception when thread were used.
</li>
</ul>
<p>
libthreadar does all this and is a completely independant piece of
software from both webdar and dar/libdar. So you can use it freely
(LGPLv3 licensing) if you want. As all project I've been
published, it is documented as much as possible, feedback is always
welcome of something is not clear, wrong or missing.
</p>
<p>
libthreadar source code can be found
<a href="https://sourceforge.net/projects/libthreadar/">here</a>,
documentation is available in source package as well as online
<a href="http://libthreadar.sourceforge.net/">here</a>
</p>
<a name="sftppubkey"><b>I have sftp pubkey authentication working with ssh/sftp, how to have dar using too this public key authentication for sftp?</b></a><br/>
<p>
The answer is as simply as adding the following option while calling dar: <code><b>-afile-auth</b></code>
</p>
<p>
Why not doing pubkey by default and falling back to password authentication?
</p>
<p>
First this is by choice, because -afile-auth also uses ~/.netrc even
when using sftp. Second it could be possible to first try public key
authentication and falling back to password authentication, but it
would require libdar to first connect, eventually failing if pubkey was
not provisionned or wrong then connecting again asking user for
password on command line. I seems more efficient doing else: file authentication
when user ask to to so, password authentication else.
The counterpart is not huge for user (you can add -afile-auth in your
~/.darrc and forget about it).
</p>
<a name="libssh2"><b>I Cannot get dar to connect to remote server using SFTP, it fails with <code>SSL peer certificate or SSH remote key was not OK</code></b></a><br/>
<p>
This may be due to several well known reasons:
</p>
<ul>
<li>dar/libdar cannot find the known_hosts file</li>
<li>if using key authentifcation instead of password, dar/libdar cannot find the private key file</li>
<li>if using key authentifcation instead of password, dar/libdar cannot find the public key file</li>
<li>You have an outdate version of libssh2 or libcurl library and lack support for <i>ecdsa</i> host keys</li>
</ul>
<p>
<u>How to workaround?</u>
<p>
<p>
For the <b>three first cases</b>, you can make use of environment variable to change the default behavior:
</p>
<code class=block>
DAR_SFTP_KNOWNHOSTS_FILE
DAR_SFTP_PUBLIC_KEYFILE
DAR_SFTP_PRIVATE_KEYFILE
</code>
<p>
They respectively default to:
</p>
<code class=block>
$HOME/.ssh/known_hosts
$HOME/.ssh/id_rsa.pub
$HOME/.ssh/id_rsa
</code>
<p>
Changing them accordingly to your need is done before running dar from the shell, for example
if you use sh or bash:
</p>
<code class=block>
export DAR_SFTP_KNOWNHOSTS_FILE=~/.ssh/known_hosts_alternative
# then use dar as expected
dar -c sftp://....
dar -t sftp://...
</code>
<p>
if you use csh or tcsh:
</p>
<code class=block>
setenv DAR_SFTP_KNOWNHOSTS_FILE ~/.ssh/known_hosts_alternative
# then use dar as expected
dar -c sftp://...
dar -t sftp://...
</code>
<p>
For the fourth and <b>last case</b>, the thing is more tricky:
</p>
<p>
First, if you don't already know what the known_hosts file is used for:
</p>
<dl>
<dd>
<i>
It is used by ssh/sftp to
validate that the host you connect to is not a pirate host trying to
put itself between you and the real sftp/ssh server you intend to
connect to. Usually the first time you connect to an sftp/ssh server
you need to validate the fingerprint of the key received from the server
(checking by another mean like phone call to the server's admin, https
web browsing to the server page, and so on). When you validate the host
key the first time, this adds a new line in known_hosts file in order
for ssh/sftp client to automatically check the next time you connect
that the host is still the correct one.
</i>
</dd>
</dl>
<p>
The known_hosts file is usually located in your home directory at
<code>~/.ssh/known_hosts</code> and looks like this:
</p>
<code class=block>
asteroide.lan <b>ecdsa-sha2-nistp256</b> AAAAE2V...
esxi,192.168.5.20 <b>ssh-rsa </b>AAAAB3N...
192.168.6.253 <b>ssh-rsa</b> AAAAB3N...
</code>
<p>
Each line concerns a different sftp/ssh server and contains three fields
<dl>
<dt class=void><code><hostame or IP></code></dt><dd>
this is the server we have already connected to
</dd>
<dt class=void><code><host-key type></code></dt><dd>
this is the type of key
</dd>
<dt class=void><code><key></code></dt><dd>
this is the public key the server has sent the first time we connected
</dd>
</dl>
<p>
We will focus on the second field.
</p>
<p>
dar/libdar relies on <i>libcurl</i> for networking protocol interaction, which
in turn relies on <i>libssh2</i>. Before <i>libssh2</i> 1.9.0 only <i>rsa</i>
host key were supported leading to this message as soon as the <i>known_hosts</i>
file contained a non-rsa host key (even another host listed in the <i>known_hosts</i>
file than the one we tend to connect).
As of December 2020, if 1.9.0 has now support for addition host key types (<i>ecdsa</i> and
<i>ed25519</i>) libcurl does not yet leverage this support and the problem persists.
I'm confident that things will be updated soon for this problem to be solved in a few months.
</p>
<p>
In the meantime, several options are available to workaround that limitation:
</p>
<ol>
<li>
disable known_hosts checking, by setting the environment
variable <code>DAR_SFTP_KNOWNHOSTS_FILE</code> to an empty string. Libdar will then
not ask libcurl/libssh2 to check for known hosts validity,
<b>but this is not a recommend option!</b>
because it opens the door to man-in-the-middle attacks.
</li>
<li>
copy the known_host file to <code>~/.ssh/known_host_for_libssh2</code>
and remove from this copy all the lines corresponding to host keys that are
not supported by libssh2, then set the <code>DAR_SFTP_KNOWNHOSTS_FILE</code>
variable to that new file. This workaround is OK only if the non
supported host key are not the one you intend to have dar communcating
with...
</li>
<li>
replace the the host key of the ssh/sftp server by an
ssh-rsa one, OK, this will most probably imply you to have root
permission on the remote ssh/sftp server... which is not possible when
using public cloud service over Internet.
</li>
</ol>
<a name="too_large"><b><code>Cannot open catalogue: Cannot handle such a too large integer.</code> What to do?</b></a><br/>
<p>
Unless using dar/libdar built in 32 bits mode, you should not meet this
error message from dar unless exceeding the 64 bits
<a href="Limitations.html#Integers">integer limits</a>.
To know which intergers type dar relies on (infinint, 32 bits or 64
bits) run dar -V and check the line <code>Integer size used</code>:
</p>
<code class=block>
<b># src/dar_suite/dar -V</b>
dar version 2.7.0_dev, Copyright (C) 2002-2020 Denis Corbin
Long options support : YES
Using libdar 6.3.0 built with compilation time options:
gzip compression (libz) : YES
bzip2 compression (libbzip2) : YES
lzo compression (liblzo2) : YES
xz compression (liblzma) : YES
zstd compression (libzstd) : YES
lz4 compression (liblz4) : YES
Strong encryption (libgcrypt): YES
Public key ciphers (gpgme) : YES
Extended Attributes support : YES
Large files support (> 2GB) : YES
ext2fs NODUMP flag support : YES
<e>Integer size used : 64 bits</e>
Thread safe support : YES
Furtive read mode support : YES
Linux ext2/3/4 FSA support : YES
Mac OS X HFS+ FSA support : NO
Linux statx() support : YES
Detected system/CPU endian : little
Posix fadvise support : YES
Large dir. speed optimi. : YES
Timestamp read accuracy : 1 nanosecond
Timestamp write accuracy : 1 nanosecond
Restores dates of symlinks : YES
Multiple threads (libthreads): YES (1.3.1)
Delta compression (librsync) : YES
Remote repository (libcurl) : YES
argon2 hashing (libargon2) : YES
compiled the Jan 7 2021 with GNUC version 8.3.0
dar is part of the Disk Backup suite (Release 2.7.0_dev)
dar comes with ABSOLUTELY NO WARRANTY; for details
type `dar -W'. This is free software, and you are welcome
to redistribute it under certain conditions; type `dar -L | more'
for details.
</code>
<p>
If you read "infinint" and see the above error message from dar, thanks to
<a href="http://dar.linux.free.fr/feedback.html">report a bug</a> this should never occur.
Else the problem appear when
using dar before release 2.5.13 either at backup creation time when
dar met a file with a negative date, or at backup reading time,
reading a backup generated by dar 2.4.x or older and containing a
file with a very distant date in the future thing dar 2.4.x and below
recorded when the system returned a negative date for a file to save.
</p>
<p>
What is a negative date? Date of files are recorded un "unix" time,
that's to say the number of second elapsed since the beginning of year
1970. A negative date is means a date before 1970, which should
normally not be met today because the few computer that existed at that
time had not such way of storing dates nor the same files and
filesystems.
</p>
<p>
However for some reasons such negative dates can be set returned by
several operating systems (Linux based ones among others) and dar today
has not the ability to record such dates (but if you need dar storing
negative dates for a good reason please fill a
<a href="index.html#Asking_for_a_new_feature">feature request</a> with the
reason you need this feature).
</p>
<p>
Since release 2.5.13 when dar the system reports a negative date for a
file to save, dar asks the user to consider the date was zero, this
requires user interaction and may not fit all needs. For that reason,
the -az option has been added to automatically assume negative dates
read from filesystem to be equal to zero (January 1st 1970, 00:00 GMT)
without user interaction.
</p>
<a name="full-from-diff"><b>I have a diff/incremental backup and I want to convert it to a full backup, how to do that?</b></a><br/>
<p>
it is possible to convert a differential backup if you also have the full
backup is has been based on, in other words: the backup of reference.
This is pretty simple to do:
</p>
<code class=block>
dar -+ new_full_backup -A backup_of_reference -@ differential_backup full-from-diff [other options]
</code>
<dl>
<dt class=void><b>new_full_backup</b></dt><dd>
is a backup that will be created according the provided other options
(compression, encryption, slicing, hashing and so on as specified on arguments).
</dd>
<dt class=void><b>backup_of_reference</b></dt><dd>
is the full backup that was used as reference for the differential backup
</dd>
<dt class=void><b>differential_backup</b></dt><dd>
is the differential backup you want to convert into a full backup
</dd>
</dl>
<p>
the important point is the last argument <code>"full-from-diff"</code> which is defined in
/etc/darrc and makes the merging operation used here (-+ option) working as expected for
the resulting backup be the same as if a full backup had been done instead of a differential
backup at the time "differential_backup" was created.
</p>
<p>
For incremental backups, (backup which reference is not a full backup) you can also use
this method but you first need to create the full backup from the incremental/differential
backup that has been used as reference for this incremental backup. Thus the process should
follow the same order used to create backups.
</p>
<a name="tapes"><b>How to use dar with tapes (like LTO tapes)?</b></a><br/>
<p>
<code>dar</code> (Disk Archive) was designed to replace <code>tar</code> (Tape archive) to leverage
the direct access brought by disks, something <code>tar</code> was not able to use. A tape by nature does not
allow to jump to a given position (or at least, it is so inefficient to skip back and forth,
that this is barely used). That said, <code>dar</code> has also evolved to replace <code>tar</code> when
it comes to use tapes (like LTO tapes) as backup media. The advantage of <code>dar</code> here is the
integrated ciphering, efficient compression (no need to compress already compressed files), resiliency,
redundancy and CRC data protection for the most interesting features.
</p>
<p><b><u>Backup operation</u></b></p>
<p>
<code>dar</code> can produce a backup on its stdout, which can be piped or redirected to a tape device.
That's easy:
</p>
<code class=block>
dar -c - (other options)... > /dev/tape
dar -c - (other options) | some_command > /dev/tape
</code>
<p>
Thing get more complicated when the backup exceeds the size of a single tape. For that reason
<code>dar_split</code> has been added to the suite of dar programs. Its purpose it to
receive the backup produce by dar on its standard input and write it to a given file
up to the time the write fails due to lack of space. At that time, it records what
was written and what still remains to be written down, close the descriptor for the target file,
display a message to the user and waits for the user to hit enter. Then it reopens the file and
continues writing the pending
data to that target file. The user is expected to have made the necessary for further writing to
this same file (or special device) to work, for example by replacing the tape by a new one
rewound at its beginning, tape that will be overwritten by the continuation of the dar
backup:
</p>
<code class=block>
dar -c - (other options)... | dar_split split_output /dev/tape
</code>
<p><b><u>Testing operation</u></b></p>
<p>
Assuming you have completed your backup over three tapes, you should now be
concerned by testing the backup:
</p>
<code class=block>
dar_split split_input /de/tape | dar -t - --sequential-read
</code>
<p>
Before running the previous call, you should have rewound all your tapes at the offset
they had when you used them to write the dar backup (their beginning, most of the time).
The first tape should have been inserted in the drive ready for reading. <code>dar</code>
nor <code>dar_split</code> know about the location of the data on tape, they will not
seek the tape forth or backward, they will just sequentially read (or write depending on
the requested operation).
</p>
<p>
when <code>dar_split</code> readings will reach the end of the tape, the process pause and let you swap
the tape with the following one. You can also take the time to rewind the tape before swapping it,
if you want. Once
the next tape is ready in the drive and set at the properly offset, just hit enter in the
<code>dar_split</code> terminal for the process to continue.
</p>
<p>
At the end of the testing <code>dar</code> will report the backup status (hopefully the
backup test will succeed) but <code>dar_split</code> does not know anything about that and still
continues to try providing data to dar, so you will have to hit CTRL-C to stop it.
</p>
<p>
to avoid stopping <code>dar_split</code> by hand, you can indicate to <code>dar_split</code>
the number of tapes used for the backup, by mean of <code>-s</code> option. If after the last tape at backup
time you wrote an EOF tape mark <code>mt -f /dev/tape weof</code> then <code>dar_split</code>
will stop by itself after that number of tape. In our example, the backup expanded over three tapes,
where from the <code>-c 3</code> option:
</p>
<code class=block>
dar_split <b>-c 3</b> split_input /dev/tape | dar -t - --sequential-read
</code>
<p><b><u>Listing operation</u></b></p>
<p>
Listing operation can be done the same way as the testing operation seen above, just replacing
<code>-t</code> by <code>-l</code>:
</p>
<code class=block>
dar_split split_input /dev/tape | dar <b>-l</b> - --sequential-read
</code>
<p>
But what a pity not to use
the isolated <i>catalogue</i> feature! <I>Catalogue</I> isolation let you keep on disk (not on tape) a
small file containing the table of content of the backup. Such small backup can be used as
backup of the internal <i>catalogue</i> of the backup (which resided on tape) to recovery corruption
of that part of the backup (this gives an additional level of protection for backup metadata).
It can also be used for backup content listing, it can be provided to <code>dar_manager</code> and
most interesting can be used as reference for incremental or differential backups in place of reading the
reference backup content from tapes.
</p>
<p>
Assuming you did not created an isolated <i>catalogue</i> at the time of the backup, let's do
it once the backup has been written to tape:
</p>
<code class=block>
dar_split split_input /dev/tape | dar -A - --sequential-read <b>-C isolated</b> -z
</code>
<p>
This will lead <code>dar</code> to read the whole backup. Thus, it is more efficient to create it "on-fly",
which means during the backup creation process, in order to avoid this additional reading operation:
</p>
<code class=block>
dar -c - <b>--on-fly-isolate isolated</b> (other options)... | dar_split split_output /dev/tape
</code>
<p>
You will get a small <code>isolated.1.dar</code> file (you can replace <i>isolated</i> after <code>-C</code>
or <code>--on-fly-isolate</code> options, by a more meaningful name of course),
file located in the current directory by default, while your backup will be sent to tapes, as already seen earlier.
</p>
<p>
The isolated <i>catalogue</i> can now be used in place of the backup on tapes, the process becomes much much faster
for listing the backup content:
</p>
<code class=block>
dar -l isolated (other options like filters)...
</code>
<p><b><u>Restoration operation</u></b></p>
<p>
You can perform a restoration the same way we did the backup testing above, just replacing <code>-t</code>
by <code>-x</code>:
</p>
<code class=block>
dar_split split_input /dev/tape | dar <b>-x</b> - --sequential-read (other options like --fs-root and so on)
</code>
<p>
But better
leverage an isolated <i>catalogue</i>, in particular if you only plan to restore a few files. Without
isolated <i>catalogue</i> dar will have to read the whole backup up to its end (the same as tar does but
for other reasons)
to reach the internal <i>catalogue</i> that contains additional information (like files that have been
remove since backup of reference was made). Using an isolated <i>catalogue</i> avoids that and let <code>dar</code>
to stop reading earlier, that's to say, once the last file to restore will have been reached in the backup.
So if this file is located near the beginning of the backup, you can save a lot of time using an isolated <i>catalogue</i>!
</p>
<code class=block>
dar_split split_input /dev/tape | dar -x - <b>-A isolated</b> --sequential-read (other options, like --fs-root and so on)
</code>
<p><b><u>Rate limiting</u></b></p>
<p>
It is sometime necessary to rate limit the output from and to tapes. <code>dar_split</code>
has a <code>-r</code> option for that purpose:
</p>
<code class=block>
dar_split <b>-r 10240000</b> split_input /dev/tape | dar ...
dar ... | dar_split <b>-r 20480000</b> split_output /dev/tape
</code>
<p>
Argument to <code>-r</code> option is expected in bytes per second.
</p>
<p><b><u>Block size</u></b></p>
<p>
Some tape device do not behave well if the data requested or sent to them uses large block of data
at once. Usually the operating system knows about that and split application provided data in smaller
blocks, if necessary. Sometimes this is not the case, where from
the <code>-b</code> option that receives the maximum block size in bytes that <code>dar_split</code> will use.
It does not matter whether the block size used when writing is different from the one use at reading time, both must
just not exceed the block size supported by the tape device:
</p>
<code class=block>
dar_split <b>-b 1048576</b> split_input /dev/tape | dar ...
dar ... | dar_split <b>-b 1048576</b> split_output /dev/tape
</code>
<p><b><u>Differential and incremental backups</u></b></p>
<p>
Differential and incremental backups are built the same way: providing the backup of reference
at the time of the backup creation, by mean of dar's <code>-A</code> option. One could use
<code>dar_split</code> twice for that: once to read the backup of reference from a set of tapes, operation
that precedes the backup itself, then a second <code>dar_split</code> command to send the backup to tapes...
The problem is that the second backup will open the tape device for writing while it has first
to be open for reading by the first <code>dar_split</code> command, in order to fetch the backup of reference.
</p>
<p>
Thus, in this context, we have no choice (unless we have two tape drives): we must rely on an isolated <i>catalogue</i>
of the backup of reference:
</p>
<code class=block>
dar -c - <b>-A isolated_cat_of_ref_backup</b> (other options)... | dar_split split_output /dev/tape
</code>
<p><b><u>dar_split and tar</u></b></p>
<p>
<code>dar_split</code> is by design a separated command from <code>dar</code>. You can thus use it with
any other command than <code>dar</code>, in particular, yes, you can use it with <code>tar</code>
if you don't want to rely on the additional features and resiliency <code>dar</code> provides.
</p>
<a name="Smallfiles"><b>Why dar does not compress small files together for better compression ratio?</b></a><br/>
<p>
Since around year 2010, this is a question/suggestion/remark/revew that haunted the dar-support mailing-list and
new feature requests, resurrecting from time to time: Why <em>dar</em> does not compress small files together in dar
archive for better compression, like <em>tar</em> does? (its grand and venerable brother).
</p>
<p>
First point to note: <em>tar</em> does not compress at all. This is gzip, bzip2, xz or other similar programs that
take as unstructured input what tar outputs, in order to produce an unstructured compressed data stream redirected
into a file.
</p>
<p>
It would be tempting to answer: "You can do the same with dar!", but there are better things to do, read below.
</p>
<p>
But before let's remind dar's design and objectives:
</p>
<ul>
<li>compression is done per file</li>
<li>a given file's data can be accessed directly</li>
</ul>
<p>
Doing so, has several advantages:
</p>
<ul>
<li>
In a given backup/archive, you can avoid compressing some file, while compressing others (gain of time and space, as compressing
already compressed file usually leads to waste storage space).
</li>
<li>
You can quickly restore a particular file, even from a several petabytes archive/backup, no need to read
(disk IO) and decompress (CPU cycles) all the data present before that file in the archive.
</li>
<li>
Your backups are more robust: if even just one byte data corruption occurred at some place in one of your
backup, it will concern only one file, but you will be able to restore all other files, even those located
after that corruption. At the
opposite, with tar's compression manner, you would lose all data following the data corruption...
</li>
</ul>
<p>
<em>dar</em> is doing that way, because tar's way was not addressing some major concerns in the backup
area. Yes, this has the drawback to degrade the compression ratio, but this is a design choice.
</p>
<p>
Now, looking for the best of both approaches, some
proposed to gather small files together and compress them together. This would not only break all the three
advantages exposed above, but also break another feature which is the order in which files are stored: Dar
does not inspect twice the same directory at backup time nor at restoration time. Doing so avoids
saving the full path of each directory and file (and at two places: in-line metadata and in the catalog).
This also leads to better performances as it better leverage disk cache for metadata (directory content). OK,
one could say that today with SSD and NVMe this is negligible, but one would ignore that direct RAM access
from cache, is still much faster than any NVMe disk access.
</p>
<p>
So, if you can't afford keeping small files uncompressed (see dar's --mincompr, -X and -I options
for example), or if compressing them with dar versus what tar does makes a so big difference that it worth
considering to compress them together, you have three options:
</p>
<ol>
<li>
<p>
<b>use tar in dar</b>
</p>
<ul>
<li>
make a tar archive of the many small files you have, just a tar file, without compression.
Note: you can automate this when entering some particular directory trees of your choices by mean of -< -> and -=
options, and remove those temporary tar file when dar exit those directories at backup time.
You would also have to exclude those files used to build the tar file you created dynamically (see
-g/-P/-X/-I/-[/-] options).
</li>
<li>
Then let dar perform the backup, compressing those tar files with other files, if they satisfy the
--mincompr size, or any other filtering of you choice (see -Z and -Y options). Doing so
can let you leverage parallel compression and reduced execution time, brought by dar, something you cannot have with
tar alone.
</li>
<li>
Of course, you benefit also of all other dar's features (slicing, ciphering, slice hashing in fly, isolated
catalogues, differential/incremental/decremental backups... and even delta binary!)
</li>
</ul>
<p>
But yes, you will lose dar's three advantages seen above, but just for those small files you have gathered in a tar in dar file,
not for the rest of what's under backup.
</p>
</li>
<li>
<p>
<b>use tar alone</b>
</p>
<p>
If dar does not match your need and/or if you do not need to leverage any of
the three dar's advantages seen above, tar is probably a better choice for you.
That's a pity, but there is not one tool that matches all needs...
</p>
</li>
<li>
<p>
<b>describe with details a new implementation/enhancement</b>
</p>
<p>
The proposal should take into account dar's design objectives (robustness to data
corruption, efficient directory seeking, fast access to any file's data) in a way
or another.
</p>
<p>
But please, do not make an imprecised proposal, that assumes it will just "magically" work: I only like magic
when I go to a magic show ;)
</p>
<p>
Thanks to detail both backup and restoration processes. Often times, pulling out the missing details one
after the other, results in something unfeasible or with unexpected complexity and/or much less
gain than expected. Also look at the <a href="Notes.html#archive_structure">Dar Archive Structure</a> to
see how it could fit or if not, what part should be redesigned and how.
</p>
</p>
</li>
</ol>
<a name="truncated"><b>What to do when a backup was interrupted?</b></a><br/>
<p>
There are different results of a backup interruption: If this was by mean of CTRL-C or
by a OS shutdown, there is a lot of chances dar could have the time to properly close the archive,
so you obtain a well structured dar backup or archive, ready for use.
It can then be used as reference for a differential backup to continue the backup process, and you
don't need to through away the interrupted archive, which saves you the time spent to get so far.
<br/>
But what if the interruption occured due to a <b>power outage</b> or <b>lack of disk space</b>?
This is what we will have a look at here.
</p>
<p>
In such condition you get a truncated archive: it is missing the table of content at its end: the so called "catalogue" (= catalog).
Unless you have used the <code>-at</code> option <u>which is not recommended</u> as it removes metadata redundancy in the archive, you should not have
to through away and restart from scratch your backup, as we can use this redundancy to rebuild the "catalogue".
</p>
<p>
But first just reminding you that, thanks to this metadata redundancy, the truncated archive is still usable, using the <code>--sequential-read</code> option.
You can thus still list its content, restore data, and so on. But of course, don't be alarmed: you will get an error at the end of
the operation as dar will look for a catalogue "tape mark" at the end of this operation, mark that has not been written to the archive.
</p>
<code class=block>
dar -t some/other/path/truncated --sequential-read [other options...]
dar -x some/other/path/truncated --sequential-read -R /where/to/restore [other options...]
</code>
<p>
... but doing that way is slow as dar reads sequentially the whole backup (like what tar does on tar archives).
Dar cannot jump directly to the files to restore as it miss the "catalogue". Hopefully such truncated archive/backup is also repairable.
Repairing the backup is done this way:
</p>
<code class=block>
dar --add-missing-catalogue some/path/repaired -A some/other/path/truncated [other options...]
# and as always: test your backup!!!
dar -t some/path/repaired
# now, your can are free to remove the old truncated backup... it is no more needed
rm some/other/path/truncated.*.dar
</code>
<p>
The repairing process does not touch the truncated archive, but creates a new "repaired" backup. If you used slicing and want to keep
that for the repaired backup, the 'other options' should specify it (with -s and -S options). Same thing if you want encryption.
Compression is kept the same so there and there is no available option to change it at repairing time.
</p>
<p>
Ok the drawback is that it leads you to copy possibly a lot of data.
</p>
</p>
<b>As an alternative</b> to the archive repairing, an isolated catalogue can be created from the truncated backup:
</p>
<code class=block>
dar -C some/path/isolated_cat -A some/other/path/truncated --alter=repair [other options...]
</code>
<p>
Here the 'other options' are usually compression, eventually encryption. Slicing is also possible but
as an isolated catalogue is usually small this is rarely used in that context. The <code>--alter=repair</code>
(or its short version <code>-arep</code>) is mandatory here for the isolation to succeed, as the source
archive is truncated which would lead the operation to fail.
Once this is done you can now test, compare, extract the backup with the assistance
of this isolated catalogue:
</p>
<code class=block>
dar -t some/other/path/truncated -A some/path/isolated_cat -affs [other options...]
dar -d some/other/path/truncated -A some/path/isolated_cat -affs -R /path/to/compare/to [other options...]
dar -x some/other/path/truncated -A some/path/isolated_cat -affs -R /path/where/to/restore [other options...]
</code>
<p>
Here the <code>-affs</code> option (which long version is <code>--alter=force-first-slice</code> is necessary
for dar not try to read the archive format version at the end of the truncated backup, but at the beginning where a copy
has been dropped. Then dar reads the table of content (the "catalogue") from the <code>isolated_cat</code>
so you can now have very quick operations when in concerns only a few files spread along the backup/archive.
</p>
<p>
Of course if you want to list the backup content or use this backup as reference for a differential backup
you only need the isolated catalog:
</p>
<code class=block>
dar -l some/path/isolated_cat [other options...]
dar -c some/new/backup -A some/path/isolated_cat -R /path/to/backup [other options...]
</code>
</div>
</body>
</html>
|