File: manual.tex

package info (click to toggle)
s3ql 5.2.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,416 kB
  • sloc: python: 19,027; cpp: 408; makefile: 147; sh: 133
file content (5526 lines) | stat: -rw-r--r-- 240,884 bytes parent folder | download
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
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
%% Generated by Sphinx.
\def\sphinxdocclass{report}
\documentclass[letterpaper,10pt,english]{sphinxmanual}
\ifdefined\pdfpxdimen
   \let\sphinxpxdimen\pdfpxdimen\else\newdimen\sphinxpxdimen
\fi \sphinxpxdimen=.75bp\relax
\ifdefined\pdfimageresolution
    \pdfimageresolution= \numexpr \dimexpr1in\relax/\sphinxpxdimen\relax
\fi
%% let collapsible pdf bookmarks panel have high depth per default
\PassOptionsToPackage{bookmarksdepth=5}{hyperref}


\PassOptionsToPackage{warn}{textcomp}
\usepackage[utf8]{inputenc}
\ifdefined\DeclareUnicodeCharacter
% support both utf8 and utf8x syntaxes
  \ifdefined\DeclareUnicodeCharacterAsOptional
    \def\sphinxDUC#1{\DeclareUnicodeCharacter{"#1}}
  \else
    \let\sphinxDUC\DeclareUnicodeCharacter
  \fi
  \sphinxDUC{00A0}{\nobreakspace}
  \sphinxDUC{2500}{\sphinxunichar{2500}}
  \sphinxDUC{2502}{\sphinxunichar{2502}}
  \sphinxDUC{2514}{\sphinxunichar{2514}}
  \sphinxDUC{251C}{\sphinxunichar{251C}}
  \sphinxDUC{2572}{\textbackslash}
\fi
\usepackage{cmap}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb,amstext}
\usepackage{babel}



\usepackage{tgtermes}
\usepackage{tgheros}
\renewcommand{\ttdefault}{txtt}



\usepackage[Bjarne]{fncychap}
\usepackage{sphinx}

\fvset{fontsize=auto}
\usepackage{geometry}


% Include hyperref last.
\usepackage{hyperref}
% Fix anchor placement for figures with captions.
\usepackage{hypcap}% it must be loaded after hyperref.
% Set up styles of URL: it should be placed after hyperref.
\urlstyle{same}


\usepackage{sphinxmessages}
\setcounter{tocdepth}{1}



\title{S3QL Documentation}
\date{Nov 02, 2024}
\release{5.2.3}
\author{Nikolaus Rath}
\newcommand{\sphinxlogo}{\vbox{}}
\renewcommand{\releasename}{Release}
\makeindex
\begin{document}

\ifdefined\shorthandoff
  \ifnum\catcode`\=\string=\active\shorthandoff{=}\fi
  \ifnum\catcode`\"=\active\shorthandoff{"}\fi
\fi

\pagestyle{empty}
\sphinxmaketitle
\pagestyle{plain}
\sphinxtableofcontents
\pagestyle{normal}
\phantomsection\label{\detokenize{index::doc}}


\sphinxstepscope


\chapter{S3QL}
\label{\detokenize{about:s3ql}}\label{\detokenize{about::doc}}
\sphinxAtStartPar
S3QL is a file system that stores all its data online using storage
services like \sphinxhref{https://cloud.google.com/storage/docs}{Google Storage}, \sphinxhref{https://aws.amazon.com/s3/}{Amazon S3}, or \sphinxhref{https://www.openstack.org/software/}{OpenStack}. S3QL
effectively provides a virtual drive of dynamic, infinite capacity that
can be accessed from any computer with internet access.

\sphinxAtStartPar
S3QL is a full featured UNIX file system that is conceptually indistinguishable from a
local file system like ext4.  Furthermore, S3QL has additional features like compression
encryption, data de\sphinxhyphen{}duplication, immutable trees and snapshotting which make it especially
suitable for online backup and archival.

\sphinxAtStartPar
S3QL is designed to favor simplicity and elegance over performance and
feature\sphinxhyphen{}creep. Care has been taken to make the source code as
readable and serviceable as possible. Solid error detection and error
handling have been included from the very first line, and S3QL comes
with extensive automated test cases for all its components.


\section{Features}
\label{\detokenize{about:features}}\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Transparency.} Conceptually, S3QL is indistinguishable from a
local file system. For example, it supports hardlinks, symlinks,
standard unix permissions, extended attributes and file
sizes up to 2 TB.

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Dynamic Size.} The size of an S3QL file system grows and shrinks
dynamically as required.

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Compression.} Before storage, all data may be compressed with the
LZMA, bzip2 or deflate (gzip) algorithm.

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Encryption.} After compression (but before upload), all data can be
AES encrypted with a 256 bit key. An additional SHA256 HMAC checksum
is used to protect the data against manipulation.

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Data De\sphinxhyphen{}duplication.} If several files have identical contents,
the redundant data will be stored only once. This works across all
files stored in the file system, and also if only some parts of the
files are identical while other parts differ.

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Immutable Trees.} Directory trees can be made immutable, so that
their contents can no longer be changed in any way whatsoever. This
can be used to ensure that backups can not be modified after they
have been made.

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Copy\sphinxhyphen{}on\sphinxhyphen{}write snapshots.} S3QL can replicate entire directory
trees without using any additional storage space. Only if one of the
copies is modified, the part of the data that has been modified will
take up additional storage space. This can be used to create
intelligent snapshots that preserve the state of a directory at
different points in time using a minimum amount of space.

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Performance independent of network latency.} All operations
that do not write or read file contents (like creating directories
or moving, renaming, and changing permissions of files and
directories) are very fast because they are carried out without any
network transactions.

\sphinxAtStartPar
S3QL achieves this by saving the entire file and directory structure
in a database. This database is locally cached and the remote
copy updated asynchronously.

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Support for low bandwidth connections.} S3QL splits file contents
into smaller blocks and caches blocks locally. This minimizes both
the number of network transactions required for reading and writing
data, and the amount of data that has to be transferred when only
parts of a file are read or written.

\end{itemize}


\section{Development Status}
\label{\detokenize{about:development-status}}
\sphinxAtStartPar
S3QL is considered stable and suitable for production use.  Starting
with version 2.17.1, S3QL uses semantic versioning. This means that
backwards\sphinxhyphen{}incompatible versions (e.g., versions that require an
upgrade of the file system revision) will be reflected in an increase
of the major version number.


\section{Supported Platforms}
\label{\detokenize{about:supported-platforms}}
\sphinxAtStartPar
S3QL is developed and tested under Linux. Users have also reported
running S3QL successfully on OS\sphinxhyphen{}X, FreeBSD and NetBSD. We try to
maintain compatibility with these systems, but (due to lack of
pre\sphinxhyphen{}release testers) we cannot guarantee that every release will run
on all non\sphinxhyphen{}Linux systems. Please report any bugs you find, and we will
try to fix them.


\section{Contributing}
\label{\detokenize{about:contributing}}
\sphinxAtStartPar
The S3QL source code is available on \sphinxhref{https://github.com/s3ql/main}{GitHub}.

\sphinxstepscope


\chapter{Installation}
\label{\detokenize{installation:installation}}\label{\detokenize{installation::doc}}
\sphinxAtStartPar
S3QL depends on several other programs and libraries that have to be
installed first. The best method to satisfy these dependencies depends
on your distribution.


\section{Dependencies}
\label{\detokenize{installation:dependencies}}
\sphinxAtStartPar
The following is a list of the programs and libraries required for
running S3QL. Generally, you should first check if your distribution
already provides a suitable packages and only install from source if
that is not the case.
\begin{itemize}
\item {} 
\sphinxAtStartPar
Kernel: Linux 3.9 or newer.

\item {} 
\sphinxAtStartPar
The \sphinxhref{http://psmisc.sf.net/}{psmisc} utilities.

\item {} 
\sphinxAtStartPar
\sphinxhref{http://www.sqlite.org/}{SQLite} version 3.7.0 or newer. SQLite
has to be installed as a \sphinxstyleemphasis{shared library} with development headers.

\item {} 
\sphinxAtStartPar
\sphinxhref{http://www.python.org/}{Python} 3.8 or newer. Make sure to also
install the development headers.

\item {} 
\sphinxAtStartPar
The following Python modules:
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxhref{https://pypi.python.org/pypi/setuptools}{setuptools}, version 1.0 or newer.

\item {} 
\sphinxAtStartPar
\sphinxhref{https://cryptography.io/en/latest/installation/}{cryptography}

\item {} 
\sphinxAtStartPar
\sphinxhref{https://pypi.python.org/pypi/defusedxml/}{defusedxml}

\item {} 
\sphinxAtStartPar
\sphinxhref{https://github.com/rogerbinns/apsw}{apsw}, version 3.42.0 or
newer.

\item {} 
\sphinxAtStartPar
\sphinxhref{https://github.com/python-trio/trio}{trio}, version 0.15 or newer.

\item {} 
\sphinxAtStartPar
\sphinxhref{https://github.com/libfuse/pyfuse3/}{pyfuse3}, any
version between 3.2.0 (inclusive) and 4.0 (exclusive)

\item {} 
\sphinxAtStartPar
\sphinxhref{http://pytest.org/}{pytest}, version 3.7 or newer (optional, to run unit tests)

\item {} 
\sphinxAtStartPar
\sphinxhref{https://github.com/systemd/python-systemd}{systemd} (optional,
for enabling systemd support). Do \sphinxstyleemphasis{not} install the module from
PyPi, this is from a third\sphinxhyphen{}party developer and incompatible with
the official module from the systemd developers.

\item {} 
\sphinxAtStartPar
\sphinxhref{https://pypi.python.org/pypi/requests/}{requests} (optional,
required for OAuth2 authentication with Google Storage)

\item {} 
\sphinxAtStartPar
\sphinxhref{https://pypi.python.org/project/google-auth/}{google\sphinxhyphen{}auth}
(optional, required for ADC authentication with Google Storage)

\item {} 
\sphinxAtStartPar
\sphinxhref{https://pypi.python.org/project/google-auth-oauthlib/}{google\sphinxhyphen{}auth\sphinxhyphen{}oauthlib}
(optional, required for browser\sphinxhyphen{}based authentication with Google Storage)

\item {} 
\sphinxAtStartPar
\sphinxhref{https://github.com/python-trio/pytest-trio}{pytest\_trio} (optional, to run unit tests)

\end{itemize}

\sphinxAtStartPar
To check if a specific module \sphinxcode{\sphinxupquote{\textless{}module\textgreater{}}} is installed, execute
\sphinxcode{\sphinxupquote{python3 \sphinxhyphen{}c \textquotesingle{}import \sphinxstyleemphasis{\textless{}module\textgreater{}};
print(\sphinxstyleemphasis{\textless{}module\textgreater{}}.\_\_version\_\_)\textquotesingle{}}}. This will result in an
\sphinxcode{\sphinxupquote{ModuleNotFoundError}} if the module is not installed, and will print the
installed version if the module is installed.

\end{itemize}


\section{Installing S3QL}
\label{\detokenize{installation:installing-s3ql}}\label{\detokenize{installation:inst-s3ql}}
\sphinxAtStartPar
To build and install S3QL, first download the release tarball from
\sphinxhref{https://github.com/s3ql/s3ql/releases}{GitHub}. Then validate the tarball using
\sphinxhref{https://github.com/aperezdc/signify}{signify}:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{signify \PYGZhy{}V \PYGZhy{}m s3ql\PYGZhy{}XX.tar.gz \PYGZhy{}p s3ql\PYGZhy{}XX.pub}
\end{sphinxVerbatim}

\sphinxAtStartPar
The \sphinxcode{\sphinxupquote{s3ql\sphinxhyphen{}XX.pub}} file needs to be obtained from a trustworthy source (it contains the
signing key). Each S3QL release contains the signing key for the release after it in the
\sphinxcode{\sphinxupquote{signify}} directory, so you only need to manually acquire this file once when you install
S3QL for the first time).

\sphinxAtStartPar
After validating the tarball, unpack it and change into the newly created \sphinxcode{\sphinxupquote{s3ql\sphinxhyphen{}X.Y.Z}}
directory. Then you have three options:
\begin{itemize}
\item {} 
\sphinxAtStartPar
Run the S3QL commands directly from the \sphinxcode{\sphinxupquote{bin/}} directory .

\item {} 
\sphinxAtStartPar
Install S3QL into \sphinxcode{\sphinxupquote{\textasciitilde{}/.local}}

\item {} 
\sphinxAtStartPar
You can install S3QL system\sphinxhyphen{}wide for all users.

\end{itemize}


\subsection{Running S3QL commands directly}
\label{\detokenize{installation:running-s3ql-commands-directly}}
\sphinxAtStartPar
Create a virtual environment in the S3QL source directory:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{python3 \PYGZhy{}m venv venv/}
\end{sphinxVerbatim}

\sphinxAtStartPar
and install S3QL dependencies with:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{venv/bin/pip install \PYGZbs{}}
\PYG{l}{  apsw cryptography defusedxml trio pyfuse3 pytest \PYGZbs{}\PYGZbs{}}
\PYG{l}{  requests google\PYGZhy{}auth google\PYGZhy{}auth\PYGZhy{}oauthlib pytest\PYGZus{}trio}
\end{sphinxVerbatim}

\sphinxAtStartPar
Then build and test S3QL with:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{venv/bin/python3 setup.py build\PYGZus{}ext \PYGZhy{}\PYGZhy{}inplace}
\PYG{l}{venv/bin/python3 \PYGZhy{}m pytest tests/}
\end{sphinxVerbatim}

\sphinxAtStartPar
If this fails, ask for help on the \sphinxhref{http://groups.google.com/group/s3ql}{mailing list} or report a bug in the \sphinxhref{https://github.com/s3ql/s3ql/issues}{issue tracker}.

\sphinxAtStartPar
You can now run the S3QL commands in \sphinxcode{\sphinxupquote{bin}} by calling e.g. \sphinxcode{\sphinxupquote{venv/bin/python3
bin/mkfs.s3ql}} or \sphinxcode{\sphinxupquote{venv/bin/python3 bin/mount.s3ql}}. When using bash, you can
also \sphinxcode{\sphinxupquote{source venv/bin/activate}} (which activates the virtual environment for
this shell) and then call the commands directly (with e.g. \sphinxcode{\sphinxupquote{bin/mkfs.s3ql}}).


\subsection{Installing S3QL for the current user}
\label{\detokenize{installation:installing-s3ql-for-the-current-user}}
\sphinxAtStartPar
Create a virtual environment with:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{python3 \PYGZhy{}m venv \PYGZti{}/.local/lib/s3ql\PYGZhy{}venv/}
\end{sphinxVerbatim}

\sphinxAtStartPar
and install S3QL dependencies with:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{\PYGZti{}/.local/lib/s3ql\PYGZhy{}venv/bin/pip install \PYGZbs{}}
\PYG{l}{  apsw cryptography defusedxml trio pyfuse3 pytest \PYGZbs{}\PYGZbs{}}
\PYG{l}{  requests google\PYGZhy{}auth google\PYGZhy{}auth\PYGZhy{}oauthlib pytest\PYGZus{}trio}
\end{sphinxVerbatim}

\sphinxAtStartPar
Then build and test S3QL with:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{\PYGZti{}/.local/lib/s3ql\PYGZhy{}venv/bin/python3 setup.py build\PYGZus{}ext \PYGZhy{}\PYGZhy{}inplace}
\PYG{l}{\PYGZti{}/.local/lib/s3ql\PYGZhy{}venv/bin/python3 \PYGZhy{}m pytest tests/}
\end{sphinxVerbatim}

\sphinxAtStartPar
If this fails, ask for help on the \sphinxhref{http://groups.google.com/group/s3ql}{mailing list} or report a bug in the \sphinxhref{https://github.com/s3ql/s3ql/issues}{issue tracker}. Otherwise, install S3QL with:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{\PYGZti{}/.local/lib/s3ql\PYGZhy{}venv/bin/python3 setup.py install \PYGZhy{}\PYGZhy{}user}
\end{sphinxVerbatim}

\sphinxAtStartPar
Make sure that \sphinxcode{\sphinxupquote{\textasciitilde{}/.local/bin}} is in your \sphinxcode{\sphinxupquote{\$PATH}}.


\subsection{Installing S3QL for all users}
\label{\detokenize{installation:installing-s3ql-for-all-users}}
\sphinxAtStartPar
As much as possible, use your system’s package manager to install S3QL
dependencies. If something is not available, install it with:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{sudo python3 \PYGZhy{}m pip install }\PYG{n+nv}{\PYGZlt{}package\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
Then build and test S3QL with:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{python3 setup.py build\PYGZus{}ext \PYGZhy{}\PYGZhy{}inplace}
\PYG{l}{python3 \PYGZhy{}m pytest tests/}
\end{sphinxVerbatim}

\sphinxAtStartPar
If this fails, ask for help on the \sphinxhref{http://groups.google.com/group/s3ql}{mailing list} or report a bug in the \sphinxhref{https://github.com/s3ql/s3ql/issues}{issue tracker}. Otherwise, install S3QL with:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{sudo python3 setup.py install}
\end{sphinxVerbatim}


\section{Development Version}
\label{\detokenize{installation:development-version}}
\sphinxAtStartPar
If you have checked out the unstable development version from the
Git repository, a bit more effort is required. You’ll also need:
\begin{itemize}
\item {} 
\sphinxAtStartPar
Version 0.28.1 or newer of the \sphinxhref{http://www.cython.org/}{Cython} compiler.

\item {} 
\sphinxAtStartPar
Version 1.2b1 or newer of the \sphinxhref{http://sphinx.pocoo.org/}{Sphinx} document processor.

\end{itemize}

\sphinxAtStartPar
With these additional dependencies installed, S3QL can be build and
tested as explained above under “Running S3QL commands directly”.
After installing the dependencies into the virtual environment,
you need to execute:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{venv/bin/python3 setup.py build\PYGZus{}cython}
\end{sphinxVerbatim}

\sphinxAtStartPar
This step will generate the file \sphinxcode{\sphinxupquote{src/s3ql/sqlite3ext.cpp}}.
It is necessary for the \sphinxcode{\sphinxupquote{build\_ext}} step.

\sphinxAtStartPar
Note that when building from the Git repository, building and testing is done with several
additional checks. This may cause compilation and/or tests to fail even though there are
no problems with functionality. For example, any use of functions that are scheduled for
deprecation in future Python version will cause tests to fail. If you would rather just
check for functionality, you can delete the \sphinxcode{\sphinxupquote{MANIFEST.in}} file. In that case, the
build system will behave as it does for a regular release.

\sphinxAtStartPar
The HTML and PDF documentation can be generated with

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{./build\PYGZus{}docs.sh}
\PYG{l}{(cd doc/pdf \PYGZam{}\PYGZam{} make)}
\end{sphinxVerbatim}


\section{Running tests requiring remote servers}
\label{\detokenize{installation:running-tests-requiring-remote-servers}}
\sphinxAtStartPar
By default, tests requiring a connection to a remote storage backend
are skipped. If you would like to run these tests too (which is always
a good idea), you have to create additional entries in your
\sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql/authinfo2}} file that tell S3QL what server and credentials to
use for these tests. These entries have the following form:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+ge}{[\PYGZlt{}BACKEND\PYGZgt{}\PYGZhy{}test]}
\PYG{l}{backend\PYGZhy{}login: }\PYG{n+nv}{\PYGZlt{}user\PYGZgt{}}
\PYG{l}{backend\PYGZhy{}password: }\PYG{n+nv}{\PYGZlt{}password\PYGZgt{}}
\PYG{l}{test\PYGZhy{}fs: }\PYG{n+nv}{\PYGZlt{}storage\PYGZhy{}url\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
Here \sphinxstyleemphasis{\textless{}BACKEND\textgreater{}} specifies the backend that you want to test
(e.g. \sphinxstyleemphasis{s3}, \sphinxstyleemphasis{s3c}, \sphinxstyleemphasis{gs}, or \sphinxstyleemphasis{swift}), \sphinxstyleemphasis{\textless{}user\textgreater{}} and \sphinxstyleemphasis{\textless{}password\textgreater{}} are
the backend authentication credentials, and \sphinxstyleemphasis{\textless{}storage\sphinxhyphen{}url\textgreater{}} specifies
the full storage URL that will be used for testing. \sphinxstylestrong{Any existing
S3QL file system in this storage URL will be destroyed during
testing}.

\sphinxAtStartPar
For example, to run tests that need connection to a Google Storage
server, you would add something like

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+ge}{[gs\PYGZhy{}test]}
\PYG{l}{backend\PYGZhy{}login: GOOGIGWLONT238MD7HZ4}
\PYG{l}{backend\PYGZhy{}password: rmEbstjscoeunt1249oes1298gauidbs3hl}
\PYG{l}{test\PYGZhy{}fs: gs://joes\PYGZhy{}gs\PYGZhy{}bucket/s3ql\PYGZus{}tests/}
\end{sphinxVerbatim}

\sphinxstepscope


\chapter{Storage Backends}
\label{\detokenize{backends:storage-backends}}\label{\detokenize{backends:id1}}\label{\detokenize{backends::doc}}
\sphinxAtStartPar
S3QL supports different \sphinxstyleemphasis{backends} to store data at different service
providers and using different protocols. A \sphinxstyleemphasis{storage url} specifies a
backend together with some backend\sphinxhyphen{}specific information and uniquely
identifies an S3QL file system. The syntax of the storage url depends on
the backend and is described for every backend below.

\sphinxAtStartPar
Furthermore, every S3QL commands that accepts a storage url also
accepts a \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}backend\sphinxhyphen{}options}} parameter than can be used to
pass backend\sphinxhyphen{}specific options to the backend module. The available
options are documented with the respective backends below.

\sphinxAtStartPar
All storage backends respect the \sphinxcode{\sphinxupquote{http\_proxy}} (for plain HTTP
connections) and \sphinxcode{\sphinxupquote{https\_proxy}} (for SSL connections)
environment variables.

\begin{sphinxadmonition}{note}{Note:}
\sphinxAtStartPar
Storage backends are not necessarily compatible. Don’t expect that
you can e.g. copy the data stored by the local backend into Amazon
S3 using some non\sphinxhyphen{}S3QL tool and then access it with S3QL’s S3
backend).
\end{sphinxadmonition}


\section{Google Storage}
\label{\detokenize{backends:google-storage}}
\sphinxAtStartPar
\sphinxhref{https://cloud.google.com/storage/}{Google Storage} is an online
storage service offered by Google. In order to use it with S3QL, make
sure that you enable the JSON API in the \sphinxhref{https://console.cloud.google.com/apis/library/}{GCP Console API Library}

\sphinxAtStartPar
The Google Storage backend uses OAuth2 authentication or \sphinxhref{https://cloud.google.com/docs/authentication/production}{ADC}
(Application Default Credentials).

\sphinxAtStartPar
To use OAuth2 authentication, specify \sphinxcode{\sphinxupquote{oauth2}} as the backend login
and a valid OAuth2 refresh token as the backend password. To obtain a
refresh token, you can use the {\hyperref[\detokenize{man/oauth_client:oauth-client}]{\sphinxcrossref{\DUrole{std,std-ref}{s3ql\_oauth\_client}}}}
program. It will instruct you to open a specific URL in your browser,
enter a code and authenticate with your Google account. Once this
procedure is complete, {\hyperref[\detokenize{man/oauth_client:oauth-client}]{\sphinxcrossref{\DUrole{std,std-ref}{s3ql\_oauth\_client}}}} will
print out the refresh token. Note that you need to do this procedure
only once, the refresh token will remain valid until you explicitly
revoke it.

\sphinxAtStartPar
To use ADC, specify \sphinxcode{\sphinxupquote{adc}} as the backend login and use an arbitrary
value for the backend password.

\sphinxAtStartPar
To create a Google Storage bucket, you can use e.g. the \sphinxhref{https://console.cloud.google.com/storage/browser}{Google
Storage Manager}. The storage URL for accessing the bucket in S3QL is
then

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{gs://}\PYG{n+nv}{\PYGZlt{}bucketname\PYGZgt{}}\PYG{l}{/}\PYG{n+nv}{\PYGZlt{}prefix\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
Here \sphinxstyleemphasis{bucketname} is the name of the bucket, and \sphinxstyleemphasis{prefix} can be an
arbitrary prefix that will be prepended to all object names used by
S3QL. This allows you to store several S3QL file systems in the same
Google Storage bucket.

\sphinxAtStartPar
The Google Storage backend accepts the following backend options:
\index{gs\_backend command line option@\spxentry{gs\_backend command line option}!ssl\sphinxhyphen{}ca\sphinxhyphen{}path@\spxentry{ssl\sphinxhyphen{}ca\sphinxhyphen{}path}}\index{ssl\sphinxhyphen{}ca\sphinxhyphen{}path@\spxentry{ssl\sphinxhyphen{}ca\sphinxhyphen{}path}!gs\_backend command line option@\spxentry{gs\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-gs_backend-arg-ssl-ca-path}}\phantomsection\label{\detokenize{backends:cmdoption-gs-backend-arg-ssl-ca-path}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{ssl\sphinxhyphen{}ca\sphinxhyphen{}path}}\sphinxcode{\sphinxupquote{=\textless{}path\textgreater{}}}}
\pysigstopsignatures
\sphinxAtStartPar
Instead of using the system’s default certificate store, validate
the server certificate against the specified CA
certificates. \sphinxcode{\sphinxupquote{\textless{}path\textgreater{}}} may be either a file containing
multiple certificates, or a directory containing one certificate
per file.

\end{fulllineitems}

\index{gs\_backend command line option@\spxentry{gs\_backend command line option}!tcp\sphinxhyphen{}timeout@\spxentry{tcp\sphinxhyphen{}timeout}}\index{tcp\sphinxhyphen{}timeout@\spxentry{tcp\sphinxhyphen{}timeout}!gs\_backend command line option@\spxentry{gs\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-gs_backend-arg-tcp-timeout}}\phantomsection\label{\detokenize{backends:cmdoption-gs-backend-arg-tcp-timeout}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{tcp\sphinxhyphen{}timeout}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
Specifies the timeout used for TCP connections. If no data can be
exchanged with the remote server for longer than this period, the
TCP connection is closed and re\sphinxhyphen{}established (default: 20 seconds).

\end{fulllineitems}



\section{Amazon S3}
\label{\detokenize{backends:amazon-s3}}
\sphinxAtStartPar
\sphinxhref{http://aws.amazon.com/s3}{Amazon S3} is the online storage service offered by \sphinxhref{http://aws.amazon.com/}{Amazon
Web Services (AWS)}.  Buckets need to be created with the \sphinxhref{https://console.aws.amazon.com/s3/home}{AWS
Management Console}. For best performance, it is
recommend to create the bucket in the geographically closest storage region.

\sphinxAtStartPar
The storage URL for accessing S3 buckets in S3QL has the form

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3://}\PYG{n+nv}{\PYGZlt{}region\PYGZgt{}}\PYG{l}{/}\PYG{n+nv}{\PYGZlt{}bucket\PYGZgt{}}\PYG{l}{/}\PYG{n+nv}{\PYGZlt{}prefix\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
\sphinxstyleemphasis{prefix} can be an arbitrary prefix that will be prepended to all
object names used by S3QL. This allows you to store several S3QL file
systems in the same S3 bucket. For example, the storage URL

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3://ap\PYGZhy{}south\PYGZhy{}1/foomart.net/data/s3ql\PYGZus{}backup/}
\end{sphinxVerbatim}

\sphinxAtStartPar
refers to the \sphinxstyleemphasis{foomart.net} bucket in the \sphinxstyleemphasis{ap\sphinxhyphen{}south\sphinxhyphen{}1} region. All
storage objects that S3QL stores in this bucket will be prefixed with
\sphinxstyleemphasis{data/s3ql\_backup/}.

\sphinxAtStartPar
The backend login and password for accessing S3 are not the user id and password that you
use to log into the Amazon Webpage, but the \sphinxstyleemphasis{AWS access key id} and \sphinxstyleemphasis{AWS secret access
key} shown under \sphinxhref{https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8\&action=access-key}{My Account/Access Identifiers}.

\sphinxAtStartPar
The Amazon S3 backend accepts the following backend options:
\index{s3\_backend command line option@\spxentry{s3\_backend command line option}!no\sphinxhyphen{}ssl@\spxentry{no\sphinxhyphen{}ssl}}\index{no\sphinxhyphen{}ssl@\spxentry{no\sphinxhyphen{}ssl}!s3\_backend command line option@\spxentry{s3\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-s3_backend-arg-no-ssl}}\phantomsection\label{\detokenize{backends:cmdoption-s3-backend-arg-no-ssl}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{no\sphinxhyphen{}ssl}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
Disable encrypted (https) connections and use plain HTTP instead.

\end{fulllineitems}

\index{s3\_backend command line option@\spxentry{s3\_backend command line option}!ssl\sphinxhyphen{}ca\sphinxhyphen{}path@\spxentry{ssl\sphinxhyphen{}ca\sphinxhyphen{}path}}\index{ssl\sphinxhyphen{}ca\sphinxhyphen{}path@\spxentry{ssl\sphinxhyphen{}ca\sphinxhyphen{}path}!s3\_backend command line option@\spxentry{s3\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-s3_backend-arg-ssl-ca-path}}\phantomsection\label{\detokenize{backends:cmdoption-s3-backend-arg-ssl-ca-path}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{ssl\sphinxhyphen{}ca\sphinxhyphen{}path}}\sphinxcode{\sphinxupquote{=\textless{}path\textgreater{}}}}
\pysigstopsignatures
\sphinxAtStartPar
Instead of using the system’s default certificate store, validate
the server certificate against the specified CA
certificates. \sphinxcode{\sphinxupquote{\textless{}path\textgreater{}}} may be either a file containing
multiple certificates, or a directory containing one certificate
per file.

\end{fulllineitems}

\index{s3\_backend command line option@\spxentry{s3\_backend command line option}!tcp\sphinxhyphen{}timeout@\spxentry{tcp\sphinxhyphen{}timeout}}\index{tcp\sphinxhyphen{}timeout@\spxentry{tcp\sphinxhyphen{}timeout}!s3\_backend command line option@\spxentry{s3\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-s3_backend-arg-tcp-timeout}}\phantomsection\label{\detokenize{backends:cmdoption-s3-backend-arg-tcp-timeout}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{tcp\sphinxhyphen{}timeout}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
Specifies the timeout used for TCP connections. If no data can be
exchanged with the remote server for longer than this period, the
TCP connection is closed and re\sphinxhyphen{}established (default: 20 seconds).

\end{fulllineitems}

\index{s3\_backend command line option@\spxentry{s3\_backend command line option}!sse@\spxentry{sse}}\index{sse@\spxentry{sse}!s3\_backend command line option@\spxentry{s3\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-s3_backend-arg-sse}}\phantomsection\label{\detokenize{backends:cmdoption-s3-backend-arg-sse}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{sse}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
Enable server side encryption. Both costs \& benefits of S3 server
side encryption are probably rather small, and this option does
\sphinxstyleemphasis{not} affect any client side encryption performed by S3QL itself.

\end{fulllineitems}

\index{s3\_backend command line option@\spxentry{s3\_backend command line option}!it@\spxentry{it}}\index{it@\spxentry{it}!s3\_backend command line option@\spxentry{s3\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-s3_backend-arg-it}}\phantomsection\label{\detokenize{backends:cmdoption-s3-backend-arg-it}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{it}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
Use INTELLIGENT\_TIERING storage class for new objects.
See \sphinxhref{https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html}{AWS S3 Storage classes}

\end{fulllineitems}

\index{s3\_backend command line option@\spxentry{s3\_backend command line option}!ia@\spxentry{ia}}\index{ia@\spxentry{ia}!s3\_backend command line option@\spxentry{s3\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-s3_backend-arg-ia}}\phantomsection\label{\detokenize{backends:cmdoption-s3-backend-arg-ia}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{ia}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
Use STANDARD\_IA (infrequent access) storage class for new objects.
See \sphinxhref{https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html}{AWS S3 Storage classes}

\end{fulllineitems}

\index{s3\_backend command line option@\spxentry{s3\_backend command line option}!oia@\spxentry{oia}}\index{oia@\spxentry{oia}!s3\_backend command line option@\spxentry{s3\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-s3_backend-arg-oia}}\phantomsection\label{\detokenize{backends:cmdoption-s3-backend-arg-oia}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{oia}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
Use ONEZONE\_IA (infrequent access) storage class for new objects.
See \sphinxhref{https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html}{AWS S3 Storage classes}

\end{fulllineitems}

\index{s3\_backend command line option@\spxentry{s3\_backend command line option}!rrs@\spxentry{rrs}}\index{rrs@\spxentry{rrs}!s3\_backend command line option@\spxentry{s3\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-s3_backend-arg-rrs}}\phantomsection\label{\detokenize{backends:cmdoption-s3-backend-arg-rrs}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{rrs}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
Enable reduced redundancy storage for newly created objects
(overwrites the \sphinxstyleemphasis{ia} option).

\sphinxAtStartPar
When enabling this option, it is strongly recommended to
periodically run {\hyperref[\detokenize{fsck:s3ql-verify}]{\sphinxcrossref{\DUrole{std,std-ref}{s3ql\_verify}}}}, because objects
that are lost by the storage backend may cause subsequent data loss
even later in time due to the data de\sphinxhyphen{}duplication feature of S3QL (see
{\hyperref[\detokenize{durability:backend-reliability}]{\sphinxcrossref{\DUrole{std,std-ref}{Data Durability}}}} for details).

\end{fulllineitems}



\section{OpenStack/Swift}
\label{\detokenize{backends:openstack-swift}}\label{\detokenize{backends:openstack-backend}}
\sphinxAtStartPar
\sphinxhref{http://www.openstack.org/}{OpenStack} is an open\sphinxhyphen{}source cloud server application suite. \sphinxhref{http://openstack.org/projects/storage/}{Swift} is
the cloud storage module of OpenStack. Swift/OpenStack storage is
offered by many different companies.

\sphinxAtStartPar
There are two different storage URL for the OpenStack backend that
make use of different authentication APIs. For legacy (v1)
authentication, the storage URL is

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{swift://}\PYG{n+nv}{\PYGZlt{}hostname\PYGZgt{}}\PYG{g+ge}{[:\PYGZlt{}port\PYGZgt{}]}\PYG{l}{/}\PYG{n+nv}{\PYGZlt{}container\PYGZgt{}}\PYG{g+ge}{[/\PYGZlt{}prefix\PYGZgt{}]}
\end{sphinxVerbatim}

\sphinxAtStartPar
for Keystone (v2 and v3) authentication, the storage URL is

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{swiftks://}\PYG{n+nv}{\PYGZlt{}hostname\PYGZgt{}}\PYG{g+ge}{[:\PYGZlt{}port\PYGZgt{}]}\PYG{l}{/}\PYG{n+nv}{\PYGZlt{}region\PYGZgt{}}\PYG{l}{:}\PYG{n+nv}{\PYGZlt{}container\PYGZgt{}}\PYG{g+ge}{[/\PYGZlt{}prefix\PYGZgt{}]}
\end{sphinxVerbatim}

\sphinxAtStartPar
When using Keystone v3 authentication, the \sphinxcode{\sphinxupquote{domain}} backend option (see below) must
be specified too.

\sphinxAtStartPar
In both cases, \sphinxstyleemphasis{hostname} name should be the name of the
authentication server.  The storage container must already exist (most
OpenStack providers offer either a web frontend or a command line tool
for creating containers). \sphinxstyleemphasis{prefix} can be an arbitrary prefix that
will be prepended to all object names used by S3QL, which can be used
to store multiple S3QL file systems in the same container.

\sphinxAtStartPar
When using legacy authentication, the backend login and password
correspond to the OpenStack username and API Access Key. When using
Keystone authentication, the backend password is your regular
OpenStack password and the backend login combines you OpenStack
username and tenant/project in the form \sphinxcode{\sphinxupquote{\textless{}tenant\textgreater{}:\textless{}user\textgreater{}}}.
If no tenant is required, the OpenStack username alone may be used as
backend login. For Keystone v2 \sphinxcode{\sphinxupquote{\textless{}tenant\textgreater{}}} needs to be the
tenant name (\sphinxcode{\sphinxupquote{OS\_TENANT\_NAME}} in the OpenStack RC File).
For Keystone v3 \sphinxcode{\sphinxupquote{\textless{}tenant\textgreater{}}} needs to be the project ID
(\sphinxcode{\sphinxupquote{OS\_TENANT\_ID}} in the OpenStack RC File).

\sphinxAtStartPar
The OpenStack backend accepts the following backend options:
\index{swift\_backend command line option@\spxentry{swift\_backend command line option}!no\sphinxhyphen{}ssl@\spxentry{no\sphinxhyphen{}ssl}}\index{no\sphinxhyphen{}ssl@\spxentry{no\sphinxhyphen{}ssl}!swift\_backend command line option@\spxentry{swift\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-swift_backend-arg-no-ssl}}\phantomsection\label{\detokenize{backends:cmdoption-swift-backend-arg-no-ssl}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{no\sphinxhyphen{}ssl}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
Use plain HTTP to connect to the authentication server. This option
does not directly affect the connection to the storage
server. Whether HTTPS or plain HTTP is used to connect to the
storage server is determined by the authentication server.

\end{fulllineitems}

\index{swift\_backend command line option@\spxentry{swift\_backend command line option}!ssl\sphinxhyphen{}ca\sphinxhyphen{}path@\spxentry{ssl\sphinxhyphen{}ca\sphinxhyphen{}path}}\index{ssl\sphinxhyphen{}ca\sphinxhyphen{}path@\spxentry{ssl\sphinxhyphen{}ca\sphinxhyphen{}path}!swift\_backend command line option@\spxentry{swift\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-swift_backend-arg-ssl-ca-path}}\phantomsection\label{\detokenize{backends:cmdoption-swift-backend-arg-ssl-ca-path}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{ssl\sphinxhyphen{}ca\sphinxhyphen{}path}}\sphinxcode{\sphinxupquote{=\textless{}path\textgreater{}}}}
\pysigstopsignatures
\sphinxAtStartPar
Instead of using the system’s default certificate store, validate
the server certificate against the specified CA
certificates. \sphinxcode{\sphinxupquote{\textless{}path\textgreater{}}} may be either a file containing
multiple certificates, or a directory containing one certificate
per file.

\end{fulllineitems}

\index{swift\_backend command line option@\spxentry{swift\_backend command line option}!tcp\sphinxhyphen{}timeout@\spxentry{tcp\sphinxhyphen{}timeout}}\index{tcp\sphinxhyphen{}timeout@\spxentry{tcp\sphinxhyphen{}timeout}!swift\_backend command line option@\spxentry{swift\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-swift_backend-arg-tcp-timeout}}\phantomsection\label{\detokenize{backends:cmdoption-swift-backend-arg-tcp-timeout}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{tcp\sphinxhyphen{}timeout}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
Specifies the timeout used for TCP connections. If no data can be
exchanged with the remote server for longer than this period, the
TCP connection is closed and re\sphinxhyphen{}established (default: 20 seconds).

\end{fulllineitems}

\index{swift\_backend command line option@\spxentry{swift\_backend command line option}!disable\sphinxhyphen{}expect100@\spxentry{disable\sphinxhyphen{}expect100}}\index{disable\sphinxhyphen{}expect100@\spxentry{disable\sphinxhyphen{}expect100}!swift\_backend command line option@\spxentry{swift\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-swift_backend-arg-disable-expect100}}\phantomsection\label{\detokenize{backends:cmdoption-swift-backend-arg-disable-expect100}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{disable\sphinxhyphen{}expect100}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
If this option is specified, S3QL does not use the \sphinxcode{\sphinxupquote{Expect:
continue}} header (cf. \sphinxhref{http://tools.ietf.org/html/rfc2616\#section-8.2.3}{RFC2616, section 8.2.3}) when uploading
data to the server. This can be used to work around broken storage
servers that don’t fully support HTTP 1.1, but may decrease
performance as object data will be transmitted to the server more
than once in some circumstances.

\end{fulllineitems}

\index{swift\_backend command line option@\spxentry{swift\_backend command line option}!no\sphinxhyphen{}feature\sphinxhyphen{}detection@\spxentry{no\sphinxhyphen{}feature\sphinxhyphen{}detection}}\index{no\sphinxhyphen{}feature\sphinxhyphen{}detection@\spxentry{no\sphinxhyphen{}feature\sphinxhyphen{}detection}!swift\_backend command line option@\spxentry{swift\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-swift_backend-arg-no-feature-detection}}\phantomsection\label{\detokenize{backends:cmdoption-swift-backend-arg-no-feature-detection}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{no\sphinxhyphen{}feature\sphinxhyphen{}detection}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
If this option is specified, S3QL does not try to dynamically detect
advanced features of the Swift backend. In this case S3QL can only
use the least common denominator of supported Swift versions and
configurations.

\end{fulllineitems}

\index{swift\_backend command line option@\spxentry{swift\_backend command line option}!domain@\spxentry{domain}}\index{domain@\spxentry{domain}!swift\_backend command line option@\spxentry{swift\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-swift_backend-arg-domain}}\phantomsection\label{\detokenize{backends:cmdoption-swift-backend-arg-domain}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{domain}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
If this option is specified, S3QL will use the Keystone v3 API. The
default domain ID for OpenStack installations is \sphinxcode{\sphinxupquote{default}}. If this
option is specified without setting the \sphinxcode{\sphinxupquote{project\sphinxhyphen{}domain}} option, this
will be used for both the project and the user domain.
You need to provide the domain ID not the domain name to this option.
If your provider did not give you a domain ID, then it is most likely
\sphinxcode{\sphinxupquote{default}}.

\end{fulllineitems}

\index{swift\_backend command line option@\spxentry{swift\_backend command line option}!domain\sphinxhyphen{}is\sphinxhyphen{}name@\spxentry{domain\sphinxhyphen{}is\sphinxhyphen{}name}}\index{domain\sphinxhyphen{}is\sphinxhyphen{}name@\spxentry{domain\sphinxhyphen{}is\sphinxhyphen{}name}!swift\_backend command line option@\spxentry{swift\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-swift_backend-arg-domain-is-name}}\phantomsection\label{\detokenize{backends:cmdoption-swift-backend-arg-domain-is-name}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{domain\sphinxhyphen{}is\sphinxhyphen{}name}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
If your provider only supplies you with the name of your domain and not the uuid,
you need to set this \sphinxcode{\sphinxupquote{domain\sphinxhyphen{}is\sphinxhyphen{}name}} option, whereby the \sphinxcode{\sphinxupquote{domain}} is used as the domain name,
not the domain id.

\end{fulllineitems}

\index{swift\_backend command line option@\spxentry{swift\_backend command line option}!project\sphinxhyphen{}domain@\spxentry{project\sphinxhyphen{}domain}}\index{project\sphinxhyphen{}domain@\spxentry{project\sphinxhyphen{}domain}!swift\_backend command line option@\spxentry{swift\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-swift_backend-arg-project-domain}}\phantomsection\label{\detokenize{backends:cmdoption-swift-backend-arg-project-domain}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{project\sphinxhyphen{}domain}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
In simple cases, the project domain will be the same as the auth
domain. If the \sphinxcode{\sphinxupquote{project\sphinxhyphen{}domain}} option is not specified, it will be
assumed to be the same as the user domain.
You need to provide the domain ID not the domain name to this option.
If your provider did not give you a domain ID, then it is most likely
\sphinxcode{\sphinxupquote{default}}.

\end{fulllineitems}

\index{swift\_backend command line option@\spxentry{swift\_backend command line option}!project\sphinxhyphen{}domain\sphinxhyphen{}is\sphinxhyphen{}name@\spxentry{project\sphinxhyphen{}domain\sphinxhyphen{}is\sphinxhyphen{}name}}\index{project\sphinxhyphen{}domain\sphinxhyphen{}is\sphinxhyphen{}name@\spxentry{project\sphinxhyphen{}domain\sphinxhyphen{}is\sphinxhyphen{}name}!swift\_backend command line option@\spxentry{swift\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-swift_backend-arg-project-domain-is-name}}\phantomsection\label{\detokenize{backends:cmdoption-swift-backend-arg-project-domain-is-name}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{project\sphinxhyphen{}domain\sphinxhyphen{}is\sphinxhyphen{}name}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
If your provider only supplies you with the name of your project domain and not the uuid,
you need to set this \sphinxcode{\sphinxupquote{project\sphinxhyphen{}domain\sphinxhyphen{}name}} option, whereby the \sphinxcode{\sphinxupquote{project\sphinxhyphen{}domain}} is used
as the name of the project domain, not the id of the project domain.
If project\sphinxhyphen{}domain\sphinxhyphen{}is\sphinxhyphen{}name is not set, it is assumed the same as domain\sphinxhyphen{}is\sphinxhyphen{}name.

\end{fulllineitems}

\index{swift\_backend command line option@\spxentry{swift\_backend command line option}!tenant\sphinxhyphen{}is\sphinxhyphen{}name@\spxentry{tenant\sphinxhyphen{}is\sphinxhyphen{}name}}\index{tenant\sphinxhyphen{}is\sphinxhyphen{}name@\spxentry{tenant\sphinxhyphen{}is\sphinxhyphen{}name}!swift\_backend command line option@\spxentry{swift\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-swift_backend-arg-tenant-is-name}}\phantomsection\label{\detokenize{backends:cmdoption-swift-backend-arg-tenant-is-name}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{tenant\sphinxhyphen{}is\sphinxhyphen{}name}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
Some providers use the tenant name to specify the storage location, and others use the tenant id.
If your provider uses the tenant name and not the id, you need to set this \sphinxcode{\sphinxupquote{tenant\sphinxhyphen{}is\sphinxhyphen{}name}} option.
If \sphinxcode{\sphinxupquote{tenant\sphinxhyphen{}is\sphinxhyphen{}name}} is provided, the \sphinxcode{\sphinxupquote{\textless{}tenant\textgreater{}}} component of the login is used as the tenant
name, not the tenant id.

\end{fulllineitems}

\index{swift\_backend command line option@\spxentry{swift\_backend command line option}!identity\sphinxhyphen{}url@\spxentry{identity\sphinxhyphen{}url}}\index{identity\sphinxhyphen{}url@\spxentry{identity\sphinxhyphen{}url}!swift\_backend command line option@\spxentry{swift\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-swift_backend-arg-identity-url}}\phantomsection\label{\detokenize{backends:cmdoption-swift-backend-arg-identity-url}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{identity\sphinxhyphen{}url}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
If your provider does not use hostname:port/v3/auth/tokens but instead has another identity URL, you can use this option.
It allows to replace /v3/auth/tokens with another path like for example /identity/v3/auth/tokens

\end{fulllineitems}



\section{Rackspace CloudFiles}
\label{\detokenize{backends:rackspace-cloudfiles}}
\sphinxAtStartPar
\sphinxhref{http://www.rackspace.com/}{Rackspace} CloudFiles uses \sphinxhref{http://www.openstack.org/}{OpenStack} internally, so it is possible to
just use the OpenStack/Swift backend (see above) with
\sphinxcode{\sphinxupquote{auth.api.rackspacecloud.com}} as the host name. For convenience,
there is also a special \sphinxcode{\sphinxupquote{rackspace}} backend that uses a storage URL
of the form

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{rackspace://}\PYG{n+nv}{\PYGZlt{}region\PYGZgt{}}\PYG{l}{/}\PYG{n+nv}{\PYGZlt{}container\PYGZgt{}}\PYG{g+ge}{[/\PYGZlt{}prefix\PYGZgt{}]}
\end{sphinxVerbatim}

\sphinxAtStartPar
The storage container must already exist in the selected
region. \sphinxstyleemphasis{prefix} can be an arbitrary prefix that will be prepended to
all object names used by S3QL and can be used to store several S3QL
file systems in the same container.

\sphinxAtStartPar
You can create a storage container for S3QL using the \sphinxhref{https://mycloud.rackspace.com/}{Cloud Control
Panel} (click on \sphinxstyleemphasis{Files} in the
topmost menu bar).

\sphinxAtStartPar
The Rackspace backend accepts the same backend options as the
{\hyperref[\detokenize{backends:openstack-backend}]{\sphinxcrossref{\DUrole{std,std-ref}{OpenStack backend}}}}.


\section{S3 compatible}
\label{\detokenize{backends:s3-compatible}}
\sphinxAtStartPar
The S3 compatible backend allows S3QL to access any storage service
that uses the same protocol as Amazon S3. The storage URL has the form

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3c://}\PYG{n+nv}{\PYGZlt{}hostname\PYGZgt{}}\PYG{l}{:}\PYG{n+nv}{\PYGZlt{}port\PYGZgt{}}\PYG{l}{/}\PYG{n+nv}{\PYGZlt{}bucketname\PYGZgt{}}\PYG{l}{/}\PYG{n+nv}{\PYGZlt{}prefix\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
Here \sphinxstyleemphasis{bucketname} is the name of an (existing) bucket, and \sphinxstyleemphasis{prefix}
can be an arbitrary prefix that will be prepended to all object names
used by S3QL. This allows you to store several S3QL file systems in
the same bucket.

\sphinxAtStartPar
\sphinxcode{\sphinxupquote{s3c://}} authenticates API requests using AWS V2 signatures, which are
deprecated by AWS but still accepted by many S3 compatible services.

\sphinxAtStartPar
\sphinxcode{\sphinxupquote{s3c4://}} denotes a variant of this backend that works the same
but uses AWS V4 signatures for request authentication instead:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3c4://}\PYG{n+nv}{\PYGZlt{}hostname\PYGZgt{}}\PYG{l}{:}\PYG{n+nv}{\PYGZlt{}port\PYGZgt{}}\PYG{l}{/}\PYG{n+nv}{\PYGZlt{}bucketname\PYGZgt{}}\PYG{l}{/}\PYG{n+nv}{\PYGZlt{}prefix\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
The S3 compatible backend accepts the following backend options:
\index{s3c\_backend command line option@\spxentry{s3c\_backend command line option}!no\sphinxhyphen{}ssl@\spxentry{no\sphinxhyphen{}ssl}}\index{no\sphinxhyphen{}ssl@\spxentry{no\sphinxhyphen{}ssl}!s3c\_backend command line option@\spxentry{s3c\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-s3c_backend-arg-no-ssl}}\phantomsection\label{\detokenize{backends:cmdoption-s3c-backend-arg-no-ssl}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{no\sphinxhyphen{}ssl}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
Disable encrypted (https) connections and use plain HTTP instead.

\end{fulllineitems}

\index{s3c\_backend command line option@\spxentry{s3c\_backend command line option}!ssl\sphinxhyphen{}ca\sphinxhyphen{}path@\spxentry{ssl\sphinxhyphen{}ca\sphinxhyphen{}path}}\index{ssl\sphinxhyphen{}ca\sphinxhyphen{}path@\spxentry{ssl\sphinxhyphen{}ca\sphinxhyphen{}path}!s3c\_backend command line option@\spxentry{s3c\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-s3c_backend-arg-ssl-ca-path}}\phantomsection\label{\detokenize{backends:cmdoption-s3c-backend-arg-ssl-ca-path}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{ssl\sphinxhyphen{}ca\sphinxhyphen{}path}}\sphinxcode{\sphinxupquote{=\textless{}path\textgreater{}}}}
\pysigstopsignatures
\sphinxAtStartPar
Instead of using the system’s default certificate store, validate
the server certificate against the specified CA
certificates. \sphinxcode{\sphinxupquote{\textless{}path\textgreater{}}} may be either a file containing
multiple certificates, or a directory containing one certificate
per file.

\end{fulllineitems}

\index{s3c\_backend command line option@\spxentry{s3c\_backend command line option}!tcp\sphinxhyphen{}timeout@\spxentry{tcp\sphinxhyphen{}timeout}}\index{tcp\sphinxhyphen{}timeout@\spxentry{tcp\sphinxhyphen{}timeout}!s3c\_backend command line option@\spxentry{s3c\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-s3c_backend-arg-tcp-timeout}}\phantomsection\label{\detokenize{backends:cmdoption-s3c-backend-arg-tcp-timeout}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{tcp\sphinxhyphen{}timeout}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
Specifies the timeout used for TCP connections. If no data can be
exchanged with the remote server for longer than this period, the
TCP connection is closed and re\sphinxhyphen{}established (default: 20 seconds).

\end{fulllineitems}

\index{s3c\_backend command line option@\spxentry{s3c\_backend command line option}!disable\sphinxhyphen{}expect100@\spxentry{disable\sphinxhyphen{}expect100}}\index{disable\sphinxhyphen{}expect100@\spxentry{disable\sphinxhyphen{}expect100}!s3c\_backend command line option@\spxentry{s3c\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-s3c_backend-arg-disable-expect100}}\phantomsection\label{\detokenize{backends:cmdoption-s3c-backend-arg-disable-expect100}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{disable\sphinxhyphen{}expect100}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
If this option is specified, S3QL does not use the \sphinxcode{\sphinxupquote{Expect:
continue}} header (cf. \sphinxhref{http://tools.ietf.org/html/rfc2616\#section-8.2.3}{RFC2616, section 8.2.3}) when uploading
data to the server. This can be used to work around broken storage
servers that don’t fully support HTTP 1.1, but may decrease
performance as object data will be transmitted to the server more
than once in some circumstances.

\end{fulllineitems}

\index{s3c\_backend command line option@\spxentry{s3c\_backend command line option}!dumb\sphinxhyphen{}copy@\spxentry{dumb\sphinxhyphen{}copy}}\index{dumb\sphinxhyphen{}copy@\spxentry{dumb\sphinxhyphen{}copy}!s3c\_backend command line option@\spxentry{s3c\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-s3c_backend-arg-dumb-copy}}\phantomsection\label{\detokenize{backends:cmdoption-s3c-backend-arg-dumb-copy}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{dumb\sphinxhyphen{}copy}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
If this option is specified, S3QL assumes that a COPY request to
the storage server has succeeded as soon as the server returns a
\sphinxcode{\sphinxupquote{200 OK}} status. The \sphinxhref{http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectCOPY.html}{S3 COPY API} specifies that the
storage server may still return an error in the request body (see
the \sphinxhref{https://doc.s3.amazonaws.com/proposals/copy.html}{copy proposal} for the rationale), so this
option should only be used if you are certain that your storage
server only returns \sphinxcode{\sphinxupquote{200 OK}} when the copy operation has been
completely and successfully carried out. Using this option may be
necessary if your storage server does not return a valid response
body for a successful copy operation.

\end{fulllineitems}

\index{s3c\_backend command line option@\spxentry{s3c\_backend command line option}!sig\sphinxhyphen{}region@\spxentry{sig\sphinxhyphen{}region}}\index{sig\sphinxhyphen{}region@\spxentry{sig\sphinxhyphen{}region}!s3c\_backend command line option@\spxentry{s3c\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-s3c_backend-arg-sig-region}}\phantomsection\label{\detokenize{backends:cmdoption-s3c-backend-arg-sig-region}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{sig\sphinxhyphen{}region}}\sphinxcode{\sphinxupquote{=\textless{}region\textgreater{}}}}
\pysigstopsignatures
\sphinxAtStartPar
For \sphinxcode{\sphinxupquote{s3c4://}} variant only: Region to use for calculating V4
request signatures. Contrary to S3, the region is not a defined
part of the storage URL and must be specified separately.
Defaults to \sphinxcode{\sphinxupquote{us\sphinxhyphen{}east\sphinxhyphen{}1}}.

\end{fulllineitems}



\section{Backblaze B2}
\label{\detokenize{backends:backblaze-b2}}
\sphinxAtStartPar
Backblaze B2 is a cloud storage with its own API.

\begin{sphinxadmonition}{warning}{Warning:}
\sphinxAtStartPar
S3QL developers do not have access to a Backblaze instance, so this backend is not
being tested before release and may break randomly. This backend depends on Backblaze
users to test and maintain it (aka submit pull requests when it doesn’t work).
\end{sphinxadmonition}

\sphinxAtStartPar
The storage URL for backblaze b2 storage is

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{b2://}\PYG{n+nv}{\PYGZlt{}bucket\PYGZhy{}name\PYGZgt{}}\PYG{g+ge}{[/\PYGZlt{}prefix\PYGZgt{}]}
\end{sphinxVerbatim}

\sphinxAtStartPar
\sphinxstyleemphasis{bucket\sphinxhyphen{}name} is an (existing) bucket which has to be accessible with
the provided account key. The \sphinxstyleemphasis{prefix} will be appended to all names
used by S3QL and can be used to hold separate S3QL repositories in the
same bucket.

\sphinxAtStartPar
It is also possible to use an application key. The required key capabilities
are the following:
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{listBuckets}}

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{listFiles}}

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{readFiles}}

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{writeFiles}}

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{deleteFiles}}

\end{itemize}
\index{b2\_backend command line option@\spxentry{b2\_backend command line option}!disable\sphinxhyphen{}versions@\spxentry{disable\sphinxhyphen{}versions}}\index{disable\sphinxhyphen{}versions@\spxentry{disable\sphinxhyphen{}versions}!b2\_backend command line option@\spxentry{b2\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-b2_backend-arg-disable-versions}}\phantomsection\label{\detokenize{backends:cmdoption-b2-backend-arg-disable-versions}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{disable\sphinxhyphen{}versions}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
If versioning of the bucket is not enabled, this option can be set.
When deleting objects, the bucket will not be scanned for all file versions
because it will be implied that only the one (the most recent) version of a
file exists. This will use only one class B transaction instead of
(possibly) multiple class C transactions.

\end{fulllineitems}

\index{b2\_backend command line option@\spxentry{b2\_backend command line option}!retry\sphinxhyphen{}on\sphinxhyphen{}cap\sphinxhyphen{}exceeded@\spxentry{retry\sphinxhyphen{}on\sphinxhyphen{}cap\sphinxhyphen{}exceeded}}\index{retry\sphinxhyphen{}on\sphinxhyphen{}cap\sphinxhyphen{}exceeded@\spxentry{retry\sphinxhyphen{}on\sphinxhyphen{}cap\sphinxhyphen{}exceeded}!b2\_backend command line option@\spxentry{b2\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-b2_backend-arg-retry-on-cap-exceeded}}\phantomsection\label{\detokenize{backends:cmdoption-b2-backend-arg-retry-on-cap-exceeded}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{retry\sphinxhyphen{}on\sphinxhyphen{}cap\sphinxhyphen{}exceeded}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
If there are data/transaction caps set for the backblaze account, this option
controls if operations should be retried as cap counters are reset every day.
Otherwise the exception would abort the program.

\end{fulllineitems}

\index{b2\_backend command line option@\spxentry{b2\_backend command line option}!test\_mode@\spxentry{test\_mode}}\index{test\_mode@\spxentry{test\_mode}!b2\_backend command line option@\spxentry{b2\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-b2_backend-arg-test_mode}}\phantomsection\label{\detokenize{backends:cmdoption-b2-backend-arg-test-mode}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{test\_mode}}\sphinxcode{\sphinxupquote{=\textless{}value\textgreater{}}}}
\pysigstopsignatures
\sphinxAtStartPar
This option puts the backblaze B2 server into test mode by adding a special header to the
requests. Use this option only to test the failure resiliency of the backend implementation as it
causes unnecessary traffic, delays and transactions.

\sphinxAtStartPar
Valid values are documented in
\sphinxurl{https://www.backblaze.com/docs/en/cloud-storage-integration-checklist} and include:
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{fail\_some\_uploads}} to randomly fail some uploads.

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{expire\_some\_account\_authorization\_tokens}} to let the server fail some authorization tokens.

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{force\_cap\_exceeded}} to let the server to behave as if the data/transaction caps were exceeded.

\end{itemize}

\end{fulllineitems}

\index{b2\_backend command line option@\spxentry{b2\_backend command line option}!tcp\sphinxhyphen{}timeout@\spxentry{tcp\sphinxhyphen{}timeout}}\index{tcp\sphinxhyphen{}timeout@\spxentry{tcp\sphinxhyphen{}timeout}!b2\_backend command line option@\spxentry{b2\_backend command line option}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{backends:cmdoption-b2_backend-arg-tcp-timeout}}\phantomsection\label{\detokenize{backends:cmdoption-b2-backend-arg-tcp-timeout}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{tcp\sphinxhyphen{}timeout}}\sphinxcode{\sphinxupquote{}}}
\pysigstopsignatures
\sphinxAtStartPar
Specifies the timeout used for TCP connections. If no data can be
exchanged with the remote server for longer than this period, the
TCP connection is closed and re\sphinxhyphen{}established (default: 20 seconds).

\end{fulllineitems}



\section{Local}
\label{\detokenize{backends:local}}
\sphinxAtStartPar
S3QL is also able to store its data on the local file system. This can
be used to backup data on external media, or to access external
services that S3QL can not talk to directly (e.g., it is possible to
store data over SSH by first mounting the remote system using \sphinxhref{http://fuse.sourceforge.net/sshfs.html}{sshfs}
and then using the local backend to store the data in the sshfs
mountpoint).

\sphinxAtStartPar
The storage URL for local storage is

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{local://}\PYG{n+nv}{\PYGZlt{}path\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
Note that you have to write three consecutive slashes to specify an
absolute path, e.g. \sphinxcode{\sphinxupquote{local:///var/archive}}. Also, relative paths will
automatically be converted to absolute paths before the authentication
file (see {\hyperref[\detokenize{authinfo:authinfo}]{\sphinxcrossref{\DUrole{std,std-ref}{Storing Backend Information and Credentials}}}}) is read, i.e. if you are in the
\sphinxcode{\sphinxupquote{/home/john}} directory and try to mount \sphinxcode{\sphinxupquote{local://s3ql}}, the
corresponding section in the authentication file must match the
storage url \sphinxcode{\sphinxupquote{local:///home/john/s3ql}}.

\sphinxAtStartPar
The local backend does not accept any backend options.

\sphinxstepscope


\chapter{Important Rules to Avoid Losing Data}
\label{\detokenize{durability:important-rules-to-avoid-losing-data}}\label{\detokenize{durability:durability}}\label{\detokenize{durability::doc}}
\sphinxAtStartPar
Most S3QL backends store data in distributed storage systems. These
systems differ from a traditional, local hard disk in several
important ways. In order to avoid losing data, this section should be
read very carefully.


\section{Rules in a Nutshell}
\label{\detokenize{durability:rules-in-a-nutshell}}
\sphinxAtStartPar
To avoid losing your data, obey the following rules:
\begin{enumerate}
\sphinxsetlistlabels{\arabic}{enumi}{enumii}{}{.}%
\item {} 
\sphinxAtStartPar
Know what durability you can expect from your chosen storage
provider. The durability describes how likely it is that a stored
object becomes damaged over time. Such data corruption can never be
prevented completely, techniques like geographic replication and
RAID storage just reduce the likelihood of it to happen (i.e.,
increase the durability).

\item {} 
\sphinxAtStartPar
When choosing a backend and storage provider, keep in mind that
when using S3QL, the effective durability of the file system data
will be reduced because of S3QL’s data de\sphinxhyphen{}duplication feature.

\item {} 
\sphinxAtStartPar
Make sure that your storage provider provides “immediate consistency” when reading, writing, and
listing storage objects. Some providers (including, in the past, Amazon S3) only support
\sphinxstyleemphasis{eventual consistency} which is \sphinxstyleemphasis{insufficient for S3QL} and can lead to complete
data\sphinxhyphen{}loss. (Eventual consistency enables higher availability, but means that changes
to an object may not be immediately visible to readers).

\item {} 
\sphinxAtStartPar
Do not attempt to mount the same file system on different computers (or on
the same computer but with different \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}cachedir}} directories)
at the same time.

\item {} 
\sphinxAtStartPar
Do not attempt to mount (or fsck) a file system on a different computer (or on
the same computer but with a different \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}cachedir}} directory)
when it was not cleanly unmounted.

\end{enumerate}


\section{Data Durability}
\label{\detokenize{durability:data-durability}}\label{\detokenize{durability:backend-reliability}}
\sphinxAtStartPar
The durability of a storage service is measure of the
probability of a storage object to become corrupted over time. The
lower the chance of data loss, the higher the durability. Storage
services like Amazon S3 claim to achieve a durability of up to
99.999999999\% over a year, i.e. if you store 100000000 objects for 100
years, you can expect that at the end of that time at most one object will be
corrupted or lost.

\sphinxAtStartPar
S3QL is designed to reduce redundancy and store data in the smallest
possible form. Therefore, S3QL is generally not able to compensate for
any such losses, and when choosing a storage service you should
carefully review if the offered durability matches your requirements.
When doing this, there are two factors that should be kept in mind.

\sphinxAtStartPar
Firstly, even though S3QL is not able to compensate for storage
service failures, it is able to detect them: when trying to access
data that has been lost or corrupted by the storage service, an IO
error will be returned.

\sphinxAtStartPar
Secondly, the consequences of a data loss by the storage service can
be significantly more severe than you may expect because of S3QL’s
data de\sphinxhyphen{}duplication feature: a data loss in the storage service at
time \sphinxstyleemphasis{x} may cause data that is written \sphinxstyleemphasis{after} time \sphinxstyleemphasis{x} to be lost as
well. Consider the following scenario:
\begin{enumerate}
\sphinxsetlistlabels{\arabic}{enumi}{enumii}{}{.}%
\item {} 
\sphinxAtStartPar
You store an important file in the S3QL file system.

\item {} 
\sphinxAtStartPar
The storage service loses the data blocks of this file. As long as you
do not access the file or run \sphinxstyleliteralstrong{\sphinxupquote{s3ql\_verify}}, S3QL is not
aware that the data has been lost by the storage service.

\item {} 
\sphinxAtStartPar
You save an additional copy of the important file in a different
location on the same S3QL file system.

\item {} 
\sphinxAtStartPar
S3QL detects that the contents of the new file are identical to the
data blocks that have been stored earlier. Since at this point S3QL
is not aware that these blocks have been lost by the storage service, it
does not save another copy of the file contents in the storage service but
relies on the (presumably) existing blocks instead.

\item {} 
\sphinxAtStartPar
Therefore, even though you saved another copy, you still do not
have a backup of the important file (since both copies refer to the
same data blocks that have been lost by the storage service).

\end{enumerate}

\sphinxAtStartPar
For some storage services, \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}} can mitigate this
effect. When \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}} runs, it asks the storage service
for a list of all stored objects. If objects are missing, it can then
mark the damaged files and prevent the problem from spreading forwards
in time. Figuratively speaking, this establishes a “checkpoint”: data
loss that occurred before running \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}} can not affect
any file system operations that are performed after the check.
Unfortunately, many storage services only “discover” that objects are
missing or broken when the object actually needs to be retrieved. In
this case, \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}} will not learn anything by just
querying the list of objects.

\sphinxAtStartPar
The problem be further mitigated by using the \sphinxstyleliteralstrong{\sphinxupquote{s3ql\_verify}} command in addition
to \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}}. \sphinxstyleliteralstrong{\sphinxupquote{s3ql\_verify}} asks the storage service to look up every
stored object and may therefore take much longer than running \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}}, but
can also offer a much stronger assurance that no data has been lost by the storage
service. To “recover” from damaged storage objects in the backend, the damaged objects
found by \sphinxstyleliteralstrong{\sphinxupquote{s3ql\_verify}} have to be explicitly deleted (so that a successive
\sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}} is able detect them as missing, correct the file system metadata, and
move any affected files to \sphinxcode{\sphinxupquote{lost+found}}). This procedure is currently not automated,
so it is generally a good idea to choose a storage service where the expected data
durability is high enough so that the possibility of a lost object (and thus the need to
run any full checks) can be neglected over long periods of time.

\sphinxstepscope


\chapter{File System Creation}
\label{\detokenize{mkfs:file-system-creation}}\label{\detokenize{mkfs::doc}}
\sphinxAtStartPar
A S3QL file system is created with the \sphinxstyleliteralstrong{\sphinxupquote{mkfs.s3ql}} command. It has the
following syntax:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{mkfs.s3ql }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}storage url\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
This command accepts the following options:
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}cachedir \textless{}path\textgreater{}]  
\sphinxAtStartPar
Store cached data in this directory (default:
\sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql)}}
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{None}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}backend\sphinxhyphen{}options \textless{}options\textgreater{}]  
\sphinxAtStartPar
Backend specific options (separate by commas). See
backend documentation for available options.
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\item [\sphinxhyphen{}\sphinxhyphen{}authfile \textless{}path\textgreater{}]  
\sphinxAtStartPar
Read authentication credentials from this file
(default: \sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql/authinfo2)}}
\item [\sphinxhyphen{}L \textless{}name\textgreater{}]  
\sphinxAtStartPar
Filesystem label
\item [\sphinxhyphen{}\sphinxhyphen{}data\sphinxhyphen{}block\sphinxhyphen{}size \textless{}size\textgreater{}]  
\sphinxAtStartPar
Block size (in KiB) to use for storing file contents.
Files larger than this size will be stored in multiple
backend objects. Backend object size may be smaller
than this due to compression. Default: 1024 KiB.
\item [\sphinxhyphen{}\sphinxhyphen{}metadata\sphinxhyphen{}block\sphinxhyphen{}size \textless{}size\textgreater{}]  
\sphinxAtStartPar
Block size (in KiB) to use for storing filesystem
metadata. Backend object size may be smaller than this
due to compression. Default: 64 KiB.
\item [\sphinxhyphen{}\sphinxhyphen{}plain]  
\sphinxAtStartPar
Create unencrypted file system.
\end{optionlist}
\end{quote}

\sphinxAtStartPar
Unless you have specified the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}plain}} option,
\sphinxstyleliteralstrong{\sphinxupquote{mkfs.s3ql}} will ask you to enter an encryption
password. This password will \sphinxstyleemphasis{not} be read from an authentication file
specified with the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}authfile}} option to prevent accidental
creation of an encrypted file system.

\sphinxAtStartPar
Note that:
\begin{itemize}
\item {} 
\sphinxAtStartPar
All data that is stored under the given storage url is assumed to
managed exclusively by S3QL. Trying to manually save additional
objects (or remove or manipulate existing objects) will lead to file
system corruption, and \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}} may delete objects that
do not belong to the file system.

\item {} 
\sphinxAtStartPar
With most storage backends, slashes in the storage url prefix do not
have special meaning. For example, the storage urls
\sphinxcode{\sphinxupquote{s3://mybucket/myprefix/}} and \sphinxcode{\sphinxupquote{s3://mybucket/myprefix}} are
distinct. In the first case, the prefix is \sphinxcode{\sphinxupquote{myprefix/}}, while in
the second it is \sphinxcode{\sphinxupquote{myprefix}}.

\item {} 
\sphinxAtStartPar
S3QL file systems can not be “stacked”, i.e. you cannot have one
file system stored at \sphinxcode{\sphinxupquote{s3://bucketname/outerprefix}} and a second
one at \sphinxcode{\sphinxupquote{s3://bucketname/outerprefix/innerprefix}}.

\end{itemize}

\sphinxstepscope


\chapter{Managing File Systems}
\label{\detokenize{adm:managing-file-systems}}\label{\detokenize{adm::doc}}
\sphinxAtStartPar
The \sphinxcode{\sphinxupquote{s3qladm}} command performs various operations on \sphinxstyleemphasis{unmounted} S3QL
file systems. The file system \sphinxstyleemphasis{must not be mounted} when using
\sphinxcode{\sphinxupquote{s3qladm}} or things will go wrong badly.

\sphinxAtStartPar
The syntax is

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qladm }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}action\PYGZgt{}}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}storage\PYGZhy{}url\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
where \sphinxcode{\sphinxupquote{action}} may be either of \sphinxstyleliteralstrong{\sphinxupquote{passphrase}}, \sphinxstyleliteralstrong{\sphinxupquote{restore\sphinxhyphen{}metadata}},
\sphinxstyleliteralstrong{\sphinxupquote{clear}}, \sphinxstyleliteralstrong{\sphinxupquote{recover\sphinxhyphen{}key}} or \sphinxstyleliteralstrong{\sphinxupquote{upgrade}}.

\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3qladm}} accepts the following general options, no
matter what specific action is being invoked:
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}authfile \textless{}path\textgreater{}]  
\sphinxAtStartPar
Read authentication credentials from this file
(default: \sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql/authinfo2)}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{None}}
\item [\sphinxhyphen{}\sphinxhyphen{}backend\sphinxhyphen{}options \textless{}options\textgreater{}]  
\sphinxAtStartPar
Backend specific options (separate by commas). See
backend documentation for available options.
\item [\sphinxhyphen{}\sphinxhyphen{}cachedir \textless{}path\textgreater{}]  
\sphinxAtStartPar
Store cached data in this directory (default:
\sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql)}}
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\end{optionlist}
\end{quote}

\sphinxAtStartPar
Hint: run \sphinxcode{\sphinxupquote{s3qladm \textless{}action\textgreater{} \sphinxhyphen{}\sphinxhyphen{}help}} to get help on the additional arguments
that the different actions take.


\section{Changing the Passphrase}
\label{\detokenize{adm:changing-the-passphrase}}
\sphinxAtStartPar
To change the passphrase of a file system, use the \sphinxcode{\sphinxupquote{passphrase}}
subcommand:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qladm passphrase  }\PYG{n+nv}{\PYGZlt{}storage url\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
This will not actually re\sphinxhyphen{}encrypt all the stored data with the new passphrase. Rather, S3QL
generates an internal “master key” when the file system is created and uses this key to
encrypt all stored data. The user\sphinxhyphen{}supplied passphrase is used to encrypt/decrypt only the
master key, and can therefore be changed. This means, however, that if a passphrase has
been disclosed to someone untrusted, changing it afterwards will \sphinxstylestrong{not revoke access to
people who had access to the old passphrase} (because they could have decrypted the
master key and retained a copy).


\section{Recovering the master key}
\label{\detokenize{adm:recovering-the-master-key}}
\sphinxAtStartPar
If you’ve been extremely unlucky, then it is possible that a bug in S3QL or data\sphinxhyphen{}loss by
your storage provider has resulted in object that holds the filesystem master key becoming
inaccessible. In this case, knowing the passphrase does not help, as there is no master
key to decrypt with it.

\sphinxAtStartPar
If you have also been diligent, then you can restore the master key from the external copy
that \sphinxstyleliteralstrong{\sphinxupquote{mkfs.s3ql}} has asked you to make on filesystem creation time:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qladm recover\PYGZhy{}key }\PYG{n+nv}{\PYGZlt{}storage url\PYGZgt{}}
\end{sphinxVerbatim}


\section{Restoring Metadata Backups}
\label{\detokenize{adm:restoring-metadata-backups}}
\sphinxAtStartPar
If the most\sphinxhyphen{}recent copy of the file system metadata has been damaged
irreparably, it is possible to restore one of the automatically
created backup copies.

\sphinxAtStartPar
The command

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qladm restore\PYGZhy{}metadata }\PYG{n+nv}{\PYGZlt{}storage url\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
will give you a list of the available metadata backups and allow you
to select one to restore.

\begin{sphinxadmonition}{warning}{Warning:}
\sphinxAtStartPar
You should probably not use this functionality without having asked
for help on the mailing list first (see {\hyperref[\detokenize{resources:resources}]{\sphinxcrossref{\DUrole{std,std-ref}{Further Resources / Getting Help}}}}).
\end{sphinxadmonition}


\section{Deleting a file system}
\label{\detokenize{adm:deleting-a-file-system}}
\sphinxAtStartPar
A file system can be deleted with:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qladm clear }\PYG{n+nv}{\PYGZlt{}storage url\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
This physically deletes all the data and file system structures.


\section{Upgrading the file system}
\label{\detokenize{adm:upgrading-the-file-system}}
\sphinxAtStartPar
If you have installed a new version of S3QL, it may sometimes be
necessary to upgrade the file system metadata as well. After this operation,
the file system can no longer be accessed with older
versions of S3QL.

\sphinxAtStartPar
During the upgrade you have to make sure that the command is not
interrupted, and that no one else tries to mount, check or upgrade the
file system at the same time.

\sphinxAtStartPar
To upgrade a file system from the previous to the current revision,
execute

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qladm upgrade }\PYG{n+nv}{\PYGZlt{}storage url\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxstepscope


\chapter{Mounting}
\label{\detokenize{mount:mounting}}\label{\detokenize{mount::doc}}
\sphinxAtStartPar
A S3QL file system is mounted with the \sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}}
command. It has the following syntax:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{mount.s3ql }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}storage url\PYGZgt{}}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}mountpoint\PYGZgt{}}
\end{sphinxVerbatim}

\begin{sphinxadmonition}{note}{Note:}
\sphinxAtStartPar
S3QL is not a network file system like \sphinxhref{http://en.wikipedia.org/wiki/Network\_File\_System\_\%28protocol\%29}{NFS}
or \sphinxhref{http://en.wikipedia.org/wiki/CIFS}{CIFS}. It can only be
mounted on one computer at a time.
\end{sphinxadmonition}

\sphinxAtStartPar
This command accepts the following options:
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql/mount.log}}
\item [\sphinxhyphen{}\sphinxhyphen{}cachedir \textless{}path\textgreater{}]  
\sphinxAtStartPar
Store cached data in this directory (default:
\sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql)}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}backend\sphinxhyphen{}options \textless{}options\textgreater{}]  
\sphinxAtStartPar
Backend specific options (separate by commas). See
backend documentation for available options.
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\item [\sphinxhyphen{}\sphinxhyphen{}authfile \textless{}path\textgreater{}]  
\sphinxAtStartPar
Read authentication credentials from this file
(default: \sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql/authinfo2)}}
\item [\sphinxhyphen{}\sphinxhyphen{}compress \textless{}algorithm\sphinxhyphen{}lvl\textgreater{}]  
\sphinxAtStartPar
Compression algorithm and compression level to use
when storing new data. \sphinxstyleemphasis{algorithm} may be any of
\sphinxcode{\sphinxupquote{lzma}}, \sphinxcode{\sphinxupquote{bzip2}}, \sphinxcode{\sphinxupquote{zlib}}, or none. \sphinxstyleemphasis{lvl} may be any
integer from 0 (fastest) to 9 (slowest). Default:
\sphinxcode{\sphinxupquote{lzma\sphinxhyphen{}6}}
\item [\sphinxhyphen{}\sphinxhyphen{}cachesize \textless{}size\textgreater{}]  
\sphinxAtStartPar
Cache size in KiB (default: autodetect).
\item [\sphinxhyphen{}\sphinxhyphen{}max\sphinxhyphen{}cache\sphinxhyphen{}entries \textless{}num\textgreater{}]  
\sphinxAtStartPar
Maximum number of entries in cache (default:
autodetect). Each cache entry requires one file
descriptor, so if you increase this number you have to
make sure that your process file descriptor limit (as
set with \sphinxcode{\sphinxupquote{ulimit \sphinxhyphen{}n}}) is high enough (at least the
number of cache entries + 100).
\item [\sphinxhyphen{}\sphinxhyphen{}keep\sphinxhyphen{}cache]  
\sphinxAtStartPar
Do not purge locally cached files on exit.
\item [\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}other]  
\sphinxAtStartPar
Normally, only the user who called \sphinxcode{\sphinxupquote{mount.s3ql}} can
access the mount point. This user then also has full
access to it, independent of individual file
permissions. If the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}other}} option is
specified, other users can access the mount point as
well and individual file permissions are taken into
account for all users.
\item [\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}root]  
\sphinxAtStartPar
Like \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}other}}, but restrict access to the
mounting user and the root user.
\item [\sphinxhyphen{}\sphinxhyphen{}dirty\sphinxhyphen{}block\sphinxhyphen{}upload\sphinxhyphen{}delay \textless{}seconds\textgreater{}]  
\sphinxAtStartPar
Upload delay for dirty blocks in seconds (default: 10
seconds).
\item [\sphinxhyphen{}\sphinxhyphen{}fg]  
\sphinxAtStartPar
Do not daemonize, stay in foreground
\item [\sphinxhyphen{}\sphinxhyphen{}fs\sphinxhyphen{}name FS\_NAME]  
\sphinxAtStartPar
Mount name passed to fuse, the name will be shown in
the first column of the system mount command output.
If not specified your storage url is used.
\item [\sphinxhyphen{}\sphinxhyphen{}systemd]  
\sphinxAtStartPar
Run as systemd unit. Consider specifying \textendash{}log none as
well to make use of journald.
\item [\sphinxhyphen{}\sphinxhyphen{}metadata\sphinxhyphen{}backup\sphinxhyphen{}interval \textless{}seconds\textgreater{}]  
\sphinxAtStartPar
Interval between metadata backups. Should the
filesystem crash while mounted, modifications made
after the most recent metadata backup may be lost.
During backups, the filesystem will be unresponsile.
Default: 6h
\item [\sphinxhyphen{}\sphinxhyphen{}threads \textless{}no\textgreater{}]  
\sphinxAtStartPar
Number of parallel upload threads to use (default:
auto).
\item [\sphinxhyphen{}\sphinxhyphen{}nfs]  
\sphinxAtStartPar
Enable some optimizations for exporting the file
system over NFS. (default: False)
\end{optionlist}
\end{quote}


\section{Permission Checking}
\label{\detokenize{mount:permission-checking}}
\sphinxAtStartPar
If the file system is mounted with neither the \sphinxcode{\sphinxupquote{allow\sphinxhyphen{}root}} nor
\sphinxcode{\sphinxupquote{allow\sphinxhyphen{}other}} option, the mounting user has full permissions on the S3QL file
system no matter the owner and mode of individual files. If one (or both) of the options
is used, standard unix permission checks apply, i.e. only the real root user has full
access and all other users (including the mounting user) are subject to permission checks.


\section{Compression Algorithms}
\label{\detokenize{mount:compression-algorithms}}
\sphinxAtStartPar
S3QL supports three compression algorithms, LZMA, Bzip2 and zlib (with
LZMA being the default). The compression algorithm can be specified
freely whenever the file system is mounted, since it affects only the
compression of new data blocks.

\sphinxAtStartPar
Roughly speaking, LZMA is slower but achieves better compression
ratios than Bzip2, while Bzip2 in turn is slower but achieves better
compression ratios than zlib.

\sphinxAtStartPar
For maximum file system performance, the best algorithm therefore depends on your network
connection speed: the compression should be just fast enough to saturate your network
connection.

\sphinxAtStartPar
To find the optimal algorithm and number of concurrent compression
operations for your system, S3QL ships with a program called
\sphinxcode{\sphinxupquote{benchmark.py}} in the \sphinxcode{\sphinxupquote{contrib}} directory. You should run this program
on a file that has a size that is roughly equal to the block size of
your file system and has similar contents. It will then determine the
compression speeds for the different algorithms and the upload speeds
for the specified backend and recommend the best algorithm that is
fast enough to saturate your network connection.

\sphinxAtStartPar
Obviously you should make sure that there is little other system load
when you run \sphinxcode{\sphinxupquote{benchmark.py}} (i.e., don’t compile software or encode
videos at the same time).


\section{Notes about Caching}
\label{\detokenize{mount:notes-about-caching}}
\sphinxAtStartPar
S3QL maintains a local cache of the file system data to speed up
access. The cache is block based, so it is possible that only parts of
a file are in the cache.


\subsection{Maximum Number of Cache Entries}
\label{\detokenize{mount:maximum-number-of-cache-entries}}
\sphinxAtStartPar
The maximum size of the cache can be configured with the
\sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}cachesize}} option. In addition to that, the maximum number
of objects in the cache is limited by the
\sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}max\sphinxhyphen{}cache\sphinxhyphen{}entries}} option, so it is possible that the cache
does not grow up to the maximum cache size because the maximum number
of cache elements has been reached. The reason for this limit is that
each cache entry requires one open file descriptor, and Linux
distributions usually limit the total number of file descriptors per
process to about a thousand.

\sphinxAtStartPar
If you specify a value for \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}max\sphinxhyphen{}cache\sphinxhyphen{}entries}}, you should
therefore make sure to also configure your system to increase the
maximum number of open file handles. This can be done temporarily with
the \sphinxstyleliteralstrong{\sphinxupquote{ulimit \sphinxhyphen{}n}} command. The method to permanently change this limit
system\sphinxhyphen{}wide depends on your distribution.


\subsection{Cache Flushing and Expiration}
\label{\detokenize{mount:cache-flushing-and-expiration}}
\sphinxAtStartPar
S3QL writes changed blocks to the backend whenever a block in the cache has not been
modified for some time, or when it runs out of cache space.  The time can set using the
\sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}dirty\sphinxhyphen{}block\sphinxhyphen{}upload\sphinxhyphen{}delay}} option.

\sphinxAtStartPar
Cache expiration (i.e., removal of blocks from the cache) is only done when the maximum
cache size is reached. S3QL always expires the least recently used blocks first.


\section{NFS Support}
\label{\detokenize{mount:nfs-support}}
\sphinxAtStartPar
S3QL filesystems can be exported over NFS. The \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}nfs}} option
is recommended to improve performance when NFS is used, but no harm
will occur when it is not specified.

\sphinxAtStartPar
NFS supports persistence of client mounts across server restarts. This
means that if a client has mounted an S3QL file system over NFS, the
server may unmount and remount the S3QL filesystem (or even reboot)
without the client being affected beyond temporarily becoming
unavailable. This poses several challenges, but is supported by S3QL
as long as no \sphinxcode{\sphinxupquote{fsck.s3ql}} operation is run:

\begin{sphinxadmonition}{warning}{Warning:}
\sphinxAtStartPar
If \sphinxcode{\sphinxupquote{fsck.s3ql}} modifies a file system in any way, all NFS
clients must unmount and re\sphinxhyphen{}mount the NFS share before the
S3QL file system is re\sphinxhyphen{}mounted on the server.
\end{sphinxadmonition}


\section{Failure Modes}
\label{\detokenize{mount:failure-modes}}
\sphinxAtStartPar
Once an S3QL file system has been mounted, there is a multitude of
problems that can occur when communicating with the remote
server. Generally, \sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}} always tries to keep the file
system as accessible as possible under the circumstances. That means
that if network connectivity is lost, data can still be written as
long as there is space in the local cache. Attempts to read data not
already present in the cache, however, will block until connection is
re\sphinxhyphen{}established. If any sort of data corruption is detected, the file
system will switch to read\sphinxhyphen{}only mode. Attempting to read files that
are affected by the corruption will return an input/output error
(\sphinxstyleemphasis{errno} set to \sphinxcode{\sphinxupquote{EIO}}).

\sphinxAtStartPar
In case of other unexpected or fatal problems, \sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}}
terminates, but does not unmount the file system. Any attempt to
access the mountpoint will result in a “Transport endpoint not
connected” error (\sphinxstyleemphasis{errno} set to \sphinxcode{\sphinxupquote{ESHUTDOWN}}). This ensures that a
mountpoint whose \sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}} process has terminated can not
be confused with a mountpoint containing an empty file system (which
would be fatal if e.g. the mountpoint is automatically mirrored). When
this has happened, the mountpoint can be cleared by using the
\sphinxstyleliteralstrong{\sphinxupquote{fusermount}} command (provided by FUSE) with the \sphinxcode{\sphinxupquote{\sphinxhyphen{}u}}
parameter.

\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}} will automatically try to re\sphinxhyphen{}establish the
connection to the server if network connectivity is lost, and retry
sending a request when the connection is established but the remote
server signals a temporary problem. These attempts will be made at
increasing intervals for a period up to 24 hours, with retry intervals
starting at 20 ms and increasing up to 5 minutes. After 24 hours,
\sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}} will give up and terminate, leaving the
mountpoint inaccessible as described above.

\sphinxAtStartPar
Generally, \sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}} will also emit log messages for any
unusual conditions that it encounters. The destination for these
messages can be set with the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} parameter. It is highly
recommended to periodically check these logs, for example with a tool
like \sphinxhref{http://sourceforge.net/projects/logcheck/}{logcheck}. Many potential issues that \sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}} may
encounter do not justify restricting access to the file system, but
should nevertheless be investigated if they occur. Checking the log
messages is the only way to find out about them.


\section{Automatic Mounting}
\label{\detokenize{mount:automatic-mounting}}
\sphinxAtStartPar
If you want to mount and umount an S3QL file system automatically at
system startup and shutdown, you should do so with a dedicated S3QL
init job (instead of using \sphinxcode{\sphinxupquote{/etc/fstab}}). When using systemd,
\sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}} can be started with \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}systemd}} to run
as a systemd service of type \sphinxcode{\sphinxupquote{notify}}.

\sphinxAtStartPar
In principle, it is also possible to automatically mount an S3QL file system with an
appropriate entry in \sphinxcode{\sphinxupquote{/etc/fstab}}. However, this is not recommended for several reasons:
\begin{itemize}
\item {} 
\sphinxAtStartPar
file systems mounted in \sphinxcode{\sphinxupquote{/etc/fstab}} will be unmounted with the \sphinxstyleliteralstrong{\sphinxupquote{umount}}
command, so your system will not wait until all data has been uploaded but shutdown (or
restart) immediately (this is a FUSE limitation, cf
\sphinxurl{https://github.com/libfuse/libfuse/issues/1}).

\item {} 
\sphinxAtStartPar
There is no way to tell the system that mounting S3QL requires a Python interpreter to
be available, so it may attempt to run \sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}} before it has mounted the
volume containing the Python interpreter.

\item {} 
\sphinxAtStartPar
There is no standard way to tell the system that internet connection has to be up before
the S3QL file system can be mounted.

\end{itemize}

\sphinxstepscope


\chapter{Advanced S3QL Features}
\label{\detokenize{special:advanced-s3ql-features}}\label{\detokenize{special::doc}}

\section{Snapshotting and Copy\sphinxhyphen{}on\sphinxhyphen{}Write}
\label{\detokenize{special:snapshotting-and-copy-on-write}}\label{\detokenize{special:s3qlcp}}
\sphinxAtStartPar
The command \sphinxcode{\sphinxupquote{s3qlcp}} can be used to duplicate a directory tree without
physically copying the file contents. This is made possible by the
data de\sphinxhyphen{}duplication feature of S3QL.

\sphinxAtStartPar
The syntax of \sphinxcode{\sphinxupquote{s3qlcp}} is:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qlcp }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}src\PYGZgt{}}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}target\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
This will replicate the contents of the directory \sphinxcode{\sphinxupquote{\textless{}src\textgreater{}}} in the
directory \sphinxcode{\sphinxupquote{\textless{}target\textgreater{}}}. \sphinxcode{\sphinxupquote{\textless{}src\textgreater{}}} has to be an existing directory and
\sphinxcode{\sphinxupquote{\textless{}target\textgreater{}}} must not exist. Moreover, both directories have to be
within the same S3QL file system.

\sphinxAtStartPar
The replication will not take any additional space for the file contents. Metadata usage
will increase proportional to the amount of directory entries and inodes. Only if one of
directories is modified later on, the modified data will take additional storage space.

\sphinxAtStartPar
\sphinxcode{\sphinxupquote{s3qlcp}} can only be called by the user that mounted the file system
and (if the file system was mounted with \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}other}} or \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}root}})
the root user.

\sphinxAtStartPar
After the replication, both source and target directory will still be completely ordinary
directories. You can regard \sphinxcode{\sphinxupquote{\textless{}src\textgreater{}}} as a snapshot of \sphinxcode{\sphinxupquote{\textless{}target\textgreater{}}} or vice versa. However,
the most common usage of \sphinxcode{\sphinxupquote{s3qlcp}} is to regularly duplicate the same source directory, say
\sphinxcode{\sphinxupquote{documents}}, to different target directories. For a e.g. monthly replication, the target
directories would typically be named something like \sphinxcode{\sphinxupquote{documents\_January}} for the
replication in January, \sphinxcode{\sphinxupquote{documents\_February}} for the replication in February etc.  In this
case it is clear that the target directories should be regarded as snapshots of the source
directory.

\sphinxAtStartPar
Exactly the same effect could be achieved by an ordinary copy program like \sphinxcode{\sphinxupquote{cp
\sphinxhyphen{}a}}. However, this procedure would be orders of magnitude slower, because \sphinxcode{\sphinxupquote{cp}} would have
to read every file completely (so that S3QL had to fetch all the data over the network
from the backend) before writing them into the destination folder (at which point S3QL
would de\sphinxhyphen{}duplicate the data).


\subsection{Snapshotting vs Hardlinking}
\label{\detokenize{special:snapshotting-vs-hardlinking}}
\sphinxAtStartPar
Snapshot support in S3QL is inspired by the hardlinking feature that
is offered by programs like \sphinxhref{http://www.samba.org/rsync}{rsync} or
\sphinxhref{http://savannah.nongnu.org/projects/storebackup}{storeBackup}.
These programs can create a hardlink instead of copying a file if an
identical file already exists in the backup. However, using hardlinks
has disadvantages:
\begin{itemize}
\item {} 
\sphinxAtStartPar
backups and restores always have to be made with a special program
that takes care of the hardlinking. The backups must not be touched
by any other programs (they may make changes that inadvertently
affect other hardlinked files)

\item {} 
\sphinxAtStartPar
special care needs to be taken to handle files which are already
hardlinked (the restore program needs to know that the hardlink was
not introduced by the backup program)

\end{itemize}

\sphinxAtStartPar
S3QL snapshots do not have these problems, and they can be used with
any backup program.


\section{Getting Statistics}
\label{\detokenize{special:getting-statistics}}\label{\detokenize{special:s3qlstat}}
\sphinxAtStartPar
You can get more information about a mounted S3QL file system with the
\sphinxcode{\sphinxupquote{s3qlstat}} command. It has the following syntax:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qlstat }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}mountpoint\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
This will print out something like this

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{Directory entries:    1488068}
\PYG{l}{Inodes:               1482991}
\PYG{l}{Data blocks:          87948}
\PYG{l}{Total data size:      400 GiB}
\PYG{l}{After de\PYGZhy{}duplication: 51 GiB (12.98\PYGZpc{} of total)}
\PYG{l}{After compression:    43 GiB (10.85\PYGZpc{} of total, 83.60\PYGZpc{} of de\PYGZhy{}duplicated)}
\PYG{l}{Database size:        172 MiB (uncompressed)}
\PYG{l}{(some values do not take into account not\PYGZhy{}yet\PYGZhy{}uploaded dirty blocks in cache)}
\end{sphinxVerbatim}

\sphinxAtStartPar
Probably the most interesting numbers are the total size of your data,
the total size after duplication, and the final size after
de\sphinxhyphen{}duplication and compression.

\sphinxAtStartPar
\sphinxcode{\sphinxupquote{s3qlstat}} can only be called by the user that mounted the file system
and (if the file system was mounted with \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}other}} or \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}root}})
the root user.

\sphinxAtStartPar
For a full list of available options, run \sphinxcode{\sphinxupquote{s3qlstat \sphinxhyphen{}\sphinxhyphen{}help}}.


\section{Immutable Trees}
\label{\detokenize{special:immutable-trees}}\label{\detokenize{special:s3qllock}}
\sphinxAtStartPar
The command \sphinxstyleliteralstrong{\sphinxupquote{s3qllock}} can be used to make a directory tree
immutable. Immutable trees can no longer be changed in any way
whatsoever. You can not add new files or directories and you can not
change or delete existing files and directories. The only way to get
rid of an immutable tree is to use the \sphinxstyleliteralstrong{\sphinxupquote{s3qlrm}} command (see
below).

\sphinxAtStartPar
For example, to make the directory tree beneath the directory
\sphinxcode{\sphinxupquote{2010\sphinxhyphen{}04\sphinxhyphen{}21}} immutable, execute

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qllock 2010\PYGZhy{}04\PYGZhy{}21}
\end{sphinxVerbatim}

\sphinxAtStartPar
Immutability is a feature designed for backups. Traditionally, backups have been made on
external tape drives. Once a backup was made, the tape drive was removed and locked away
somewhere. This means that the contents of the backup are permanently fixed. Nothing
(short of physical destruction) can change or delete files in the backup.

\sphinxAtStartPar
In contrast, when backing up into an online storage system like S3QL,
all backups are available every time the file system is mounted.
Nothing prevents a file in an old backup from being changed again
later on. In the worst case, this may make your entire backup system
worthless. Imagine that your system gets infected by a virus
that simply deletes all files it can find \textendash{} if the virus is active
while the backup file system is mounted, the virus will destroy all
backups together with the originals.

\sphinxAtStartPar
Even in the absence of malware,, being able to change a backup after it has been made is
generally not a good idea. A common S3QL use case is to keep the file system mounted at
all times and periodically create backups with \sphinxstyleliteralstrong{\sphinxupquote{rsync \sphinxhyphen{}a}}. This allows every user
to recover her files from a backup without having to call the system
administrator. However, this also allows every user to accidentally change or delete files
\sphinxstyleemphasis{in} one of the old backups.

\sphinxAtStartPar
Making a backup immutable protects you against all these problems.
Unless you happen to run into a virus that was specifically programmed
to attack S3QL file systems, backups can be neither deleted nor
changed after they have been made immutable.


\section{Fast Recursive Removal}
\label{\detokenize{special:fast-recursive-removal}}\label{\detokenize{special:s3qlrm}}
\sphinxAtStartPar
The \sphinxcode{\sphinxupquote{s3qlrm}} command can be used to recursively delete files and
directories on an S3QL file system. Although \sphinxcode{\sphinxupquote{s3qlrm}} is faster than
using e.g. \sphinxcode{\sphinxupquote{rm \sphinxhyphen{}r}}, the main reason for its existence is that it
allows you to delete immutable trees as well. The syntax is rather
simple:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qlrm }\PYG{n+nv}{\PYGZlt{}directory\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
Be warned that there is no additional confirmation. The directory will
be removed entirely and immediately.


\section{Runtime Configuration}
\label{\detokenize{special:runtime-configuration}}\label{\detokenize{special:s3qlctrl}}\begin{quote}

\sphinxAtStartPar
s3qlctrl {[}options{]} \textless{}action\textgreater{} \textless{}mountpoint\textgreater{} …
\end{quote}

\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3qlctrl}} command performs various actions on the S3QL file system mounted
in \sphinxcode{\sphinxupquote{mountpoint}}.

\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{s3qlctrl}} can only be called by the user that mounted the file system and (if
the file system was mounted with \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}other}} or \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}root}}) the
root user.

\sphinxAtStartPar
The following actions may be specified:
\begin{quote}
\begin{quote}\begin{description}
\sphinxlineitem{flushcache}
\sphinxAtStartPar
Write all modified blocks to the backend. The command blocks until the
cache is clean.

\sphinxlineitem{dropcache}
\sphinxAtStartPar
Flush the filesystem cache and then drop all contents (i.e., make the cache
empty).

\sphinxlineitem{log}
\sphinxAtStartPar
Change the amount of information that is logged. The complete syntax is:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qlctrl }\PYG{g+ge}{[options]}\PYG{l}{ log }\PYG{n+nv}{\PYGZlt{}mountpoint\PYGZgt{}}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}level\PYGZgt{}}\PYG{l}{ }\PYG{g+ge}{[\PYGZlt{}module\PYGZgt{} ...]}
\end{sphinxVerbatim}

\sphinxAtStartPar
here \sphinxcode{\sphinxupquote{level}} is the desired new log level and may be either of \sphinxstyleemphasis{debug},
\sphinxstyleemphasis{info} or \sphinxstyleemphasis{warn}. One or more \sphinxcode{\sphinxupquote{module}} may only be specified with the
\sphinxstyleemphasis{debug} level and allow to restrict the debug output to just the listed
modules.

\sphinxlineitem{cachesize}
\sphinxAtStartPar
Changes the cache size of the file
system. This action requires an additional argument that specifies the new
cache size in KiB, so the complete command line is:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qlctrl }\PYG{g+ge}{[options]}\PYG{l}{ cachesize }\PYG{n+nv}{\PYGZlt{}mountpoint\PYGZgt{}}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}new\PYGZhy{}cache\PYGZhy{}size\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxlineitem{backup\sphinxhyphen{}metadata}
\sphinxAtStartPar
Trigger a metadata backup.

\end{description}\end{quote}
\end{quote}

\sphinxstepscope


\chapter{Unmounting}
\label{\detokenize{umount:unmounting}}\label{\detokenize{umount::doc}}
\sphinxAtStartPar
To unmount an S3QL file system, use the command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{umount.s3ql }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}mountpoint\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
This will block until all data has been written to the backend.

\sphinxAtStartPar
Only the user who mounted the file system with \sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}}
is able to unmount it again. If you are root and want to unmount an
S3QL file system mounted by an ordinary user, you have to use the
\sphinxstyleliteralstrong{\sphinxupquote{fusermount \sphinxhyphen{}u}} or \sphinxstyleliteralstrong{\sphinxupquote{umount}} command instead. Note
that these commands do not block until all data has been uploaded, so
if you use them instead of \sphinxcode{\sphinxupquote{umount.s3ql}} then you should manually wait
for the \sphinxcode{\sphinxupquote{mount.s3ql}} process to terminate before shutting down the
system.

\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{umount.s3ql}} command accepts the following options:
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{None}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\item [\sphinxhyphen{}\sphinxhyphen{}lazy, \sphinxhyphen{}z]  
\sphinxAtStartPar
Lazy umount. Detaches the file system immediately,
even if there are still open files. The data will be
uploaded in the background once all open files have
been closed.
\end{optionlist}
\end{quote}

\sphinxAtStartPar
If, for some reason, the \sphinxcode{\sphinxupquote{umount.s3ql}} command does not work, the file
system can also be unmounted with \sphinxcode{\sphinxupquote{fusermount \sphinxhyphen{}u \sphinxhyphen{}z}}. Note that this
command will return immediately and the file system may continue to
upload data in the background for a while longer.

\sphinxstepscope


\chapter{Checking for Errors}
\label{\detokenize{fsck:checking-for-errors}}\label{\detokenize{fsck::doc}}
\sphinxAtStartPar
It is recommended to periodically run the \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}} and
\sphinxstyleliteralstrong{\sphinxupquote{s3ql\_verify}} commands (in this order) to ensure that the
file system is consistent, and that there has been no data corruption
or data loss in the storage backend.

\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}} is intended to detect and correct problems with
the internal file system structure, caused by e.g. a file system crash
or a bug in S3QL. It assumes that the storage backend can be fully
trusted, i.e. if the backend reports that a specific storage object
exists, \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}} takes that as proof that the data is
present and intact.

\sphinxAtStartPar
In contrast to that, the \sphinxstyleliteralstrong{\sphinxupquote{s3ql\_verify}} command is intended to
check the consistency of the storage backend. It assumes that the
internal file system data is correct, and verifies that all data can
actually be retrieved from the backend. Running \sphinxstyleliteralstrong{\sphinxupquote{s3ql\_verify}}
may therefore take much longer than running \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}}.


\section{Checking and repairing internal file system errors}
\label{\detokenize{fsck:checking-and-repairing-internal-file-system-errors}}
\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}} checks that the internal file system structure is
consistent and attempts to correct any problems it finds. If an S3QL
file system has not been unmounted correctly for any reason, you need
to run \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}} before you can mount the file system
again.

\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}} command has the following syntax:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{fsck.s3ql }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}storage url\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
This command accepts the following options:
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql/fsck.log}}
\item [\sphinxhyphen{}\sphinxhyphen{}cachedir \textless{}path\textgreater{}]  
\sphinxAtStartPar
Store cached data in this directory (default:
\sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql)}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}backend\sphinxhyphen{}options \textless{}options\textgreater{}]  
\sphinxAtStartPar
Backend specific options (separate by commas). See
backend documentation for available options.
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\item [\sphinxhyphen{}\sphinxhyphen{}authfile \textless{}path\textgreater{}]  
\sphinxAtStartPar
Read authentication credentials from this file
(default: \sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql/authinfo2)}}
\item [\sphinxhyphen{}\sphinxhyphen{}compress \textless{}algorithm\sphinxhyphen{}lvl\textgreater{}]  
\sphinxAtStartPar
Compression algorithm and compression level to use
when storing new data. \sphinxstyleemphasis{algorithm} may be any of
\sphinxcode{\sphinxupquote{lzma}}, \sphinxcode{\sphinxupquote{bzip2}}, \sphinxcode{\sphinxupquote{zlib}}, or none. \sphinxstyleemphasis{lvl} may be any
integer from 0 (fastest) to 9 (slowest). Default:
\sphinxcode{\sphinxupquote{lzma\sphinxhyphen{}6}}
\item [\sphinxhyphen{}\sphinxhyphen{}keep\sphinxhyphen{}cache]  
\sphinxAtStartPar
Do not purge locally cached files on exit.
\item [\sphinxhyphen{}\sphinxhyphen{}batch]  
\sphinxAtStartPar
If user input is required, exit without prompting.
\item [\sphinxhyphen{}\sphinxhyphen{}force]  
\sphinxAtStartPar
Force checking even if file system is marked clean.
\item [\sphinxhyphen{}\sphinxhyphen{}force\sphinxhyphen{}remote]  
\sphinxAtStartPar
Force use of remote metadata even when this would
likely result in data loss.
\end{optionlist}
\end{quote}


\section{Detecting and handling backend data corruption}
\label{\detokenize{fsck:detecting-and-handling-backend-data-corruption}}\label{\detokenize{fsck:s3ql-verify}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3ql\_verify}} command verifies all data in the file
system.  In contrast to \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}}, \sphinxstyleliteralstrong{\sphinxupquote{s3ql\_verify}}
does not trust the object listing returned by the backend, but
actually attempts to retrieve every object. By default,
\sphinxstyleliteralstrong{\sphinxupquote{s3ql\_verify}} will attempt to retrieve just the metadata for
every object (for e.g. the S3\sphinxhyphen{}compatible or Google Storage backends
this corresponds to a \sphinxcode{\sphinxupquote{HEAD}} request for each object), which is
generally sufficient to determine if the object still exists. When
specifying the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}data}} option, \sphinxstyleliteralstrong{\sphinxupquote{s3ql\_verify}} will
instead read every object entirely. To determine how much data will be
transmitted in total when using \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}data}}, look at the \sphinxstyleemphasis{After
compression} row in the {\hyperref[\detokenize{special:s3qlstat}]{\sphinxcrossref{\DUrole{std,std-ref}{s3qlstat}}}} output.

\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{s3ql\_verify}} is not able to correct any data corruption that
it finds. Instead, a list of the corrupted and/or missing objects is
written to a file and the decision about the proper course of action
is left to the user. If you have administrative access to the backend
server, you may want to investigate the cause of the corruption or
check if the missing/corrupted objects can be restored from
backups. If you believe that the missing/corrupted objects are indeed
lost irrevocably, you can use the {\hyperref[\detokenize{contrib:remove-objects}]{\sphinxcrossref{\DUrole{std,std-ref}{remove\_objects.py}}}} script (from
the \sphinxcode{\sphinxupquote{contrib}} directory of the S3QL distribution) to explicitly
delete the objects from the storage backend. After that, you should
run \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}}. Since the (now explicitly deleted) objects
should now no longer be included in the object index reported by the
backend, \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}} will identify the objects as missing,
update the internal file system structures accordingly, and move the
affected files into the \sphinxcode{\sphinxupquote{lost+found}} directory.

\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3ql\_verify}} command has the following syntax:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3ql\PYGZus{}verify }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}storage url\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
This command accepts the following options:
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{None}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\item [\sphinxhyphen{}\sphinxhyphen{}cachedir \textless{}path\textgreater{}]  
\sphinxAtStartPar
Store cached data in this directory (default:
\sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql)}}
\item [\sphinxhyphen{}\sphinxhyphen{}backend\sphinxhyphen{}options \textless{}options\textgreater{}]  
\sphinxAtStartPar
Backend specific options (separate by commas). See
backend documentation for available options.
\item [\sphinxhyphen{}\sphinxhyphen{}authfile \textless{}path\textgreater{}]  
\sphinxAtStartPar
Read authentication credentials from this file
(default: \sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql/authinfo2)}}
\item [\sphinxhyphen{}\sphinxhyphen{}missing\sphinxhyphen{}file \textless{}name\textgreater{}]  
\sphinxAtStartPar
File to store keys of missing objects.
\item [\sphinxhyphen{}\sphinxhyphen{}corrupted\sphinxhyphen{}file \textless{}name\textgreater{}]  
\sphinxAtStartPar
File to store keys of corrupted objects.
\item [\sphinxhyphen{}\sphinxhyphen{}data]  
\sphinxAtStartPar
Read every object completely, instead of checking just
the metadata.
\item [\sphinxhyphen{}\sphinxhyphen{}parallel PARALLEL]  
\sphinxAtStartPar
Number of connections to use in parallel.
\item [\sphinxhyphen{}\sphinxhyphen{}start\sphinxhyphen{}with \textless{}n\textgreater{}]  
\sphinxAtStartPar
Skip over first \textless{}n\textgreater{} objects and with verifying object
\textless{}n\textgreater{}+1.
\end{optionlist}
\end{quote}

\sphinxstepscope


\chapter{Storing Backend Information and Credentials}
\label{\detokenize{authinfo:storing-backend-information-and-credentials}}\label{\detokenize{authinfo:authinfo}}\label{\detokenize{authinfo::doc}}
\sphinxAtStartPar
Normally, S3QL reads username and password for the backend as well as
an encryption passphrase for the file system from the
terminal. Alternatively, these (and some other backend parameters) may
be specified in the \sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql/authinfo2}} file, or a file specified by the
\sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}authfile}} parameter.

\sphinxAtStartPar
The authinfo file consists of sections, led by a \sphinxcode{\sphinxupquote{{[}section{]}}}
header and followed by \sphinxcode{\sphinxupquote{name: value}} entries. The section headers
themselves are not used by S3QL (with the exception of the special \sphinxcode{\sphinxupquote{{[}\textless{}backend\textgreater{}\sphinxhyphen{}test{]}}}
sections used when running tests) but have to be unique within the file.

\sphinxAtStartPar
In each section, the following entries can be defined:
\begin{quote}\begin{description}
\sphinxlineitem{storage\sphinxhyphen{}url}
\sphinxAtStartPar
Specifies the storage url to which this section applies. If a
storage url starts with the string specified here, the section applies.

\sphinxlineitem{backend\sphinxhyphen{}login}
\sphinxAtStartPar
Specifies the username to use for authentication with the backend.

\sphinxlineitem{backend\sphinxhyphen{}password}
\sphinxAtStartPar
Specifies the password to use for authentication with the backend.

\sphinxlineitem{fs\sphinxhyphen{}passphrase}
\sphinxAtStartPar
Specifies the passphrase to use to decrypt the file system (if
it is encrypted).

\end{description}\end{quote}

\sphinxAtStartPar
Furthermore, command line parameters that are shared between all S3QL
commands that work with storage URL may be specified in this file as
well by omitting the leading dashes, e.g. the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}backend\sphinxhyphen{}options
notls}} parameter may be written into the authinfo file as
\sphinxcode{\sphinxupquote{backend\sphinxhyphen{}options: notls}}.

\sphinxAtStartPar
When reading the authinfo file, S3QL considers every applicable
section in order and uses the last value that it found for each entry.
For example, consider the following authentication file:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+ge}{[s3]}
\PYG{l}{storage\PYGZhy{}url: s3://}
\PYG{l}{backend\PYGZhy{}login: joe}
\PYG{l}{backend\PYGZhy{}password: notquitesecret}

\PYG{g+ge}{[fs1]}
\PYG{l}{storage\PYGZhy{}url: s3://joes\PYGZhy{}first\PYGZhy{}bucket}
\PYG{l}{fs\PYGZhy{}passphrase: neitheristhis}

\PYG{g+ge}{[fs2]}
\PYG{l}{storage\PYGZhy{}url: s3://joes\PYGZhy{}second\PYGZhy{}bucket}
\PYG{l}{fs\PYGZhy{}passphrase: swordfish}

\PYG{g+ge}{[fs3]}
\PYG{l}{storage\PYGZhy{}url: s3://joes\PYGZhy{}second\PYGZhy{}bucket/with\PYGZhy{}prefix}
\PYG{l}{backend\PYGZhy{}login: bill}
\PYG{l}{backend\PYGZhy{}password: bi23ll}
\PYG{l}{fs\PYGZhy{}passphrase: ll23bi}
\end{sphinxVerbatim}

\sphinxAtStartPar
With this authentication file, S3QL would try to log in as “joe”
whenever the s3 backend is used, except when accessing a storage url
that begins with “s3://joes\sphinxhyphen{}second\sphinxhyphen{}bucket/with\sphinxhyphen{}prefix”. In that case,
the last section becomes active and S3QL would use the “bill”
credentials. Furthermore, file system encryption passphrases will be used
for storage urls that start with “s3://joes\sphinxhyphen{}first\sphinxhyphen{}bucket” or
“s3://joes\sphinxhyphen{}second\sphinxhyphen{}bucket”.

\sphinxAtStartPar
The authentication file is parsed by the \sphinxhref{http://docs.python.org/library/configparser.html}{Python ConfigParser
module}.

\sphinxstepscope


\chapter{Contributed Programs}
\label{\detokenize{contrib:contributed-programs}}\label{\detokenize{contrib::doc}}
\sphinxAtStartPar
S3QL comes with a few contributed programs that are not part of the
core distribution (and are therefore not installed automatically by
default), but which may nevertheless be useful. These programs are in
the \sphinxcode{\sphinxupquote{contrib}} directory of the source distribution or in
\sphinxcode{\sphinxupquote{/usr/share/doc/s3ql/contrib}} if you installed S3QL from a package.


\section{benchmark.py}
\label{\detokenize{contrib:benchmark-py}}
\sphinxAtStartPar
This program measures S3QL write performance, uplink bandwidth and
compression speed to determine the limiting factor. It also gives
recommendation for compression algorithm and number of upload threads
to achieve maximum performance.


\section{pcp.py}
\label{\detokenize{contrib:pcp-py}}\label{\detokenize{contrib:pcp}}
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{pcp.py}} is a wrapper program that starts several rsync processes to
copy directory trees in parallel. This is important because
transferring files in parallel significantly enhances performance when
copying data from an S3QL file system (see {\hyperref[\detokenize{tips:copy-performance}]{\sphinxcrossref{\DUrole{std,std-ref}{Improving copy performance}}}} for
details).

\sphinxAtStartPar
To recursively copy the directory \sphinxcode{\sphinxupquote{/mnt/home\sphinxhyphen{}backup}} into
\sphinxcode{\sphinxupquote{/home/joe}} using 8 parallel processes and preserving permissions,
you would execute

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{pcp.py \PYGZhy{}a \PYGZhy{}\PYGZhy{}processes=8 /mnt/home\PYGZhy{}backup/ /home/joe}
\end{sphinxVerbatim}


\section{s3ql\_backup.sh}
\label{\detokenize{contrib:s3ql-backup-sh}}
\sphinxAtStartPar
This is an example script that demonstrates how to set up a simple but
powerful backup solution using S3QL and \sphinxhref{http://samba.org/rsync}{rsync}.

\sphinxAtStartPar
The \sphinxcode{\sphinxupquote{s3ql\_backup.sh}} script automates the following steps:
\begin{enumerate}
\sphinxsetlistlabels{\arabic}{enumi}{enumii}{}{.}%
\item {} 
\sphinxAtStartPar
Mount the file system

\item {} 
\sphinxAtStartPar
Replicate the previous backup with {\hyperref[\detokenize{special:s3qlcp}]{\sphinxcrossref{\DUrole{std,std-ref}{s3qlcp}}}}

\item {} 
\sphinxAtStartPar
Update the new copy with the data from the backup source using rsync

\item {} 
\sphinxAtStartPar
Make the new backup immutable with {\hyperref[\detokenize{special:s3qllock}]{\sphinxcrossref{\DUrole{std,std-ref}{s3qllock}}}}

\item {} 
\sphinxAtStartPar
Delete old backups that are no longer needed

\item {} 
\sphinxAtStartPar
Unmount the file system

\end{enumerate}

\sphinxAtStartPar
The backups are stored in directories of the form
\sphinxcode{\sphinxupquote{YYYY\sphinxhyphen{}MM\sphinxhyphen{}DD\_HH:mm:SS}} and the {\hyperref[\detokenize{contrib:expire-backups-py}]{\sphinxcrossref{expire\_backups.py}}} command is used to
delete old backups.


\section{expire\_backups.py}
\label{\detokenize{contrib:expire-backups-py}}
\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{expire\_backups.py}} is a program to intelligently remove old
backups that are no longer needed.

\sphinxAtStartPar
To define what backups you want to keep for how long, you define a
number of \sphinxstyleemphasis{age ranges}. \sphinxstyleliteralstrong{\sphinxupquote{expire\_backups}} ensures that you
will have at least one backup in each age range at all times. It will
keep exactly as many backups as are required for that and delete any
backups that become redundant.

\sphinxAtStartPar
Age ranges are specified by giving a list of range boundaries in terms
of backup cycles. Every time you create a new backup, the existing
backups age by one cycle.

\sphinxAtStartPar
Example: when \sphinxstyleliteralstrong{\sphinxupquote{expire\_backups}} is called with the age range
definition \sphinxcode{\sphinxupquote{1 3 7 14 31}}, it will guarantee that you always have the
following backups available:
\begin{enumerate}
\sphinxsetlistlabels{\arabic}{enumi}{enumii}{}{.}%
\item {} 
\sphinxAtStartPar
A backup that is 0 to 1 cycles old (i.e, the most recent backup)

\item {} 
\sphinxAtStartPar
A backup that is 1 to 3 cycles old

\item {} 
\sphinxAtStartPar
A backup that is 3 to 7 cycles old

\item {} 
\sphinxAtStartPar
A backup that is 7 to 14 cycles old

\item {} 
\sphinxAtStartPar
A backup that is 14 to 31 cycles old

\end{enumerate}

\begin{sphinxadmonition}{note}{Note:}
\sphinxAtStartPar
If you do backups in fixed intervals, then one cycle will be
equivalent to the backup interval. The advantage of specifying the
age ranges in terms of backup cycles rather than days or weeks is
that it allows you to gracefully handle irregular backup intervals.
Imagine that for some reason you do not turn on your computer for
one month. Now all your backups are at least a month old, and if you
had specified the above backup strategy in terms of absolute ages,
they would all be deleted! Specifying age ranges in terms of backup
cycles avoids these sort of problems.
\end{sphinxadmonition}

\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{expire\_backups}} usage is simple. It requires backups to be
stored in directories of the form \sphinxcode{\sphinxupquote{year\sphinxhyphen{}month\sphinxhyphen{}day\_hour:minute:seconds}}
(\sphinxcode{\sphinxupquote{YYYY\sphinxhyphen{}MM\sphinxhyphen{}DD\_HH:mm:ss}}) and works on all backups in the current
directory. So for the above backup strategy, the correct invocation
would be:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{expire\PYGZus{}backups.py 1 3 7 14 31}
\end{sphinxVerbatim}

\sphinxAtStartPar
When storing your backups on an S3QL file system, you probably want to
specify the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}use\sphinxhyphen{}s3qlrm}} option as well. This tells
\sphinxstyleliteralstrong{\sphinxupquote{expire\_backups}} to use the {\hyperref[\detokenize{special:s3qlrm}]{\sphinxcrossref{\DUrole{std,std-ref}{s3qlrm}}}} command to
delete directories.

\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{expire\_backups}} uses a “state file” to keep track which
backups are how many cycles old (since this cannot be inferred from
the dates contained in the directory names). The standard name for
this state file is \sphinxcode{\sphinxupquote{.expire\_backups.dat}}. If this file gets
damaged or deleted, \sphinxstyleliteralstrong{\sphinxupquote{expire\_backups}} no longer knows the ages
of the backups and refuses to work. In this case you can use the
\sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}reconstruct\sphinxhyphen{}state}} option to try to reconstruct the state
from the backup dates. However, the accuracy of this reconstruction
depends strongly on how rigorous you have been with making backups (it
is only completely correct if the time between subsequent backups has
always been exactly the same), so it’s generally a good idea not to
tamper with the state file.

\sphinxAtStartPar
For a full list of available options, run \sphinxstyleliteralstrong{\sphinxupquote{expire\_backups.py
\sphinxhyphen{}\sphinxhyphen{}help}}.


\section{remove\_objects.py}
\label{\detokenize{contrib:remove-objects-py}}\label{\detokenize{contrib:remove-objects}}
\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{remove\_objects.py}} is a program to remove a list of objects
from a storage backend. Since it acts on the backend\sphinxhyphen{}level, the
backend need not contain an S3QL file system.

\sphinxstepscope


\chapter{Tips \& Tricks}
\label{\detokenize{tips:tips-tricks}}\label{\detokenize{tips::doc}}

\section{SSH Backend}
\label{\detokenize{tips:ssh-backend}}\label{\detokenize{tips:ssh-tipp}}
\sphinxAtStartPar
By combining S3QL’s local backend with \sphinxhref{http://fuse.sourceforge.net/sshfs.html}{sshfs}, it is possible to store an
S3QL file system on arbitrary SSH servers: first mount the remote
target directory into the local filesystem,

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{sshfs user@my.server.com:/mnt/s3ql /mnt/sshfs}
\end{sphinxVerbatim}

\sphinxAtStartPar
and then give the mountpoint to S3QL as a local destination:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{mount.s3ql local:///mnt/sshfs/myfsdata /mnt/s3ql}
\end{sphinxVerbatim}


\section{Permanently mounted backup file system}
\label{\detokenize{tips:permanently-mounted-backup-file-system}}
\sphinxAtStartPar
If you use S3QL as a backup file system, it can be useful to mount the
file system permanently (rather than just mounting it for a backup and
unmounting it afterwards). Especially if your file system becomes
large, this saves you long mount\sphinxhyphen{} and unmount times if you only want
to restore a single file.

\sphinxAtStartPar
If you decide to do so, you should make sure to
\begin{itemize}
\item {} 
\sphinxAtStartPar
Use {\hyperref[\detokenize{special:s3qllock}]{\sphinxcrossref{\DUrole{std,std-ref}{s3qllock}}}} to ensure that backups are immutable
after they have been made.

\item {} 
\sphinxAtStartPar
Call {\hyperref[\detokenize{special:s3qlctrl}]{\sphinxcrossref{\DUrole{std,std-ref}{s3qlctrl backup\sphinxhyphen{}metadata}}}} right after a every
backup to make sure that the newest metadata is stored safely.

\end{itemize}


\section{Improving copy performance}
\label{\detokenize{tips:improving-copy-performance}}\label{\detokenize{tips:copy-performance}}
\begin{sphinxadmonition}{note}{Note:}
\sphinxAtStartPar
The following applies only when copying data \sphinxstylestrong{from} an S3QL file
system, \sphinxstylestrong{not} when copying data \sphinxstylestrong{to} an S3QL file system.
\end{sphinxadmonition}

\sphinxAtStartPar
If you want to copy a lot of smaller files \sphinxstyleemphasis{from} an S3QL file system
(e.g. for a system restore) you will probably notice that the
performance is rather bad.

\sphinxAtStartPar
The reason for this is intrinsic to the way S3QL works. Whenever you
read a file, S3QL first has to retrieve this file over the network
from the backend. This takes a minimum amount of time (the network
latency), no matter how big or small the file is. So when you copy
lots of small files, 99\% of the time is actually spend waiting for
network data.

\sphinxAtStartPar
Theoretically, this problem is easy to solve: you just have to copy
several files at the same time. In practice, however, almost all unix
utilities (\sphinxcode{\sphinxupquote{cp}}, \sphinxcode{\sphinxupquote{rsync}}, \sphinxcode{\sphinxupquote{tar}} and friends) insist on copying
data one file at a time. This makes a lot of sense when copying data
on the local hard disk, but in case of S3QL this is really
unfortunate.

\sphinxAtStartPar
The best workaround that has been found so far is to copy files by
starting several rsync processes at once and use exclusion rules to
make sure that they work on different sets of files.

\sphinxAtStartPar
For example, the following script will start 3 rsync instances. The
first instance handles all filenames starting with a\sphinxhyphen{}f, the second the
filenames from g\sphinxhyphen{}l and the third covers the rest. The \sphinxcode{\sphinxupquote{+ */}} rule
ensures that every instance looks into all directories.

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{c}{\PYGZsh{}!/bin/bash}

\PYG{l}{RSYNC\PYGZus{}ARGS=\PYGZdq{}\PYGZhy{}aHv /mnt/s3ql/ /home/restore/\PYGZdq{}}

\PYG{l}{rsync \PYGZhy{}f \PYGZdq{}+ */\PYGZdq{} \PYGZhy{}f \PYGZdq{}\PYGZhy{}! }\PYG{g+ge}{[a\PYGZhy{}f]}\PYG{l}{*\PYGZdq{} \PYGZdl{}RSYNC\PYGZus{}ARGS \PYGZam{}}
\PYG{l}{rsync \PYGZhy{}f \PYGZdq{}+ */\PYGZdq{} \PYGZhy{}f \PYGZdq{}\PYGZhy{}! }\PYG{g+ge}{[g\PYGZhy{}l]}\PYG{l}{*\PYGZdq{} \PYGZdl{}RSYNC\PYGZus{}ARGS \PYGZam{}}
\PYG{l}{rsync \PYGZhy{}f \PYGZdq{}+ */\PYGZdq{} \PYGZhy{}f \PYGZdq{}\PYGZhy{} }\PYG{g+ge}{[a\PYGZhy{}l]}\PYG{l}{*\PYGZdq{} \PYGZdl{}RSYNC\PYGZus{}ARGS \PYGZam{}}

\PYG{l}{wait}
\end{sphinxVerbatim}

\sphinxAtStartPar
The optimum number of parallel processes depends on your network
connection and the size of the files that you want to transfer.
However, starting about 10 processes seems to be a good compromise
that increases performance dramatically in almost all situations.

\sphinxAtStartPar
S3QL comes with a script named \sphinxcode{\sphinxupquote{pcp.py}} in the \sphinxcode{\sphinxupquote{contrib}} directory
that can be used to transfer files in parallel without having to write
an explicit script first. See the description of {\hyperref[\detokenize{contrib:pcp}]{\sphinxcrossref{\DUrole{std,std-ref}{pcp.py}}}} for
details.

\sphinxstepscope


\chapter{Frequently Asked Questions}
\label{\detokenize{faq:frequently-asked-questions}}\label{\detokenize{faq::doc}}

\section{How can I improve the file system throughput?}
\label{\detokenize{faq:how-can-i-improve-the-file-system-throughput}}
\sphinxAtStartPar
There are three possible limiting factors for file system throughput:
\begin{enumerate}
\sphinxsetlistlabels{\arabic}{enumi}{enumii}{}{.}%
\item {} 
\sphinxAtStartPar
Throughput from process through kernel to S3QL

\item {} 
\sphinxAtStartPar
Compression speed

\item {} 
\sphinxAtStartPar
Upload speed

\end{enumerate}

\sphinxAtStartPar
To figure out what’s the limiting factor in your case, you can use the
script \sphinxcode{\sphinxupquote{contrib/benchmark.py}} in the S3QL tarball. It will
determine the individual throughputs, and also give a recommendation
for compression algorithm and number of upload threads.


\section{Why does \sphinxstyleliteralintitle{\sphinxupquote{df}} show 1 TB of free space?}
\label{\detokenize{faq:why-does-df-show-1-tb-of-free-space}}
\sphinxAtStartPar
The file system size of S3QL is unlimited. However, most Unix
utilities (including \sphinxcode{\sphinxupquote{df}}) have no concept of an infinite size, so
S3QL has to provide some numerical value. Therefore, S3QL always
reports that the file system is 50\% free, but it also reports at least
1 TB. This means that if you store 1.5 TB you will have another 1.5 TB
free, but if you store just 2 MB, you will still have TB free rather
than just another 2 MB.


\section{Which operating systems are supported?}
\label{\detokenize{faq:which-operating-systems-are-supported}}
\sphinxAtStartPar
S3QL is developed on Linux, but should in principle work on all FUSE
supported operating systems that have the required Python modules. The
\sphinxstyleliteralstrong{\sphinxupquote{umount.s3ql}} program does some tricks which may not work on
non\sphinxhyphen{}Linux systems, but you can always umount with the \sphinxcode{\sphinxupquote{fusermount
\sphinxhyphen{}u}} command provided by FUSE itself (the only difference is that it
will not block until all data has been uploaded to S3 but return
immediately). Please report your success (or failure) with other
operating systems on the mailing list, so that this information can be
extended.


\section{Is there a file size limit?}
\label{\detokenize{faq:is-there-a-file-size-limit}}
\sphinxAtStartPar
No, S3QL puts no limits on the size of your files. Any limits on
maximum object size imposed by the storage service do not matter for
S3QL, since files are automatically and transparently split into
smaller blocks.


\section{Suppose I want to make a small change in a very large file. Will S3QL download and re\sphinxhyphen{}upload the entire file?}
\label{\detokenize{faq:suppose-i-want-to-make-a-small-change-in-a-very-large-file-will-s3ql-download-and-re-upload-the-entire-file}}
\sphinxAtStartPar
No, S3QL splits files in blocks of a configurable size (default: 10 MB). So to make a small change in a big file, only one block needs to be transferred and not the entire file.


\section{I don’t quite understand this de\sphinxhyphen{}duplication feature…}
\label{\detokenize{faq:i-don-t-quite-understand-this-de-duplication-feature}}
\sphinxAtStartPar
The great thing about data de\sphinxhyphen{}duplication is that you don’t need to know anything about it and will still get all the benefits. Towards you, S3QL will behave and look exactly like a file system without data duplication. When talking to the storage backend, however, the S3QL will try to store identical data only once and thus occupy less space than an ordinary file system would.


\section{What does the “Transport endpoint not connected” error mean?}
\label{\detokenize{faq:what-does-the-transport-endpoint-not-connected-error-mean}}
\sphinxAtStartPar
It means that the file system has crashed. Please check \sphinxcode{\sphinxupquote{mount.log}} and
\sphinxcode{\sphinxupquote{mount.s3ql\_crit.log}} for a more useful error message and report a bug if
appropriate.

\sphinxAtStartPar
To make the mountpoint available again (i.e., unmount the crashed file system), use the
\sphinxcode{\sphinxupquote{fusermount \sphinxhyphen{}u}} command.

\sphinxAtStartPar
Before reporting a bug, please make sure that you’re using the most recent S3QL version.


\section{What does “Backend reports that fs is still mounted elsewhere, aborting” mean?}
\label{\detokenize{faq:what-does-backend-reports-that-fs-is-still-mounted-elsewhere-aborting-mean}}
\sphinxAtStartPar
It means that either the file systems has not been unmounted cleanly or is still
mounted. If you are sure that the file system is not mounted anywhere, run
\sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}}, ideally on the computer where the file system has been mounted most
recently.


\section{Can I access an S3QL file system on multiple computers simultaneously?}
\label{\detokenize{faq:can-i-access-an-s3ql-file-system-on-multiple-computers-simultaneously}}
\sphinxAtStartPar
To share a file system between several computers, you need to have a
method for these computers to communicate, so that they can tell each
other when they are changing data. However, S3QL is designed to store
data in cloud storage services which can not be used for this kind of
communication, because different computers may end up talking to
different servers in the cloud (and there is no way for S3QL to force
the cloud servers to synchronize quickly and often enough).

\sphinxAtStartPar
Therefore, the only way to share an S3QL file system among different
computers is to have one “master” computer that runs \sphinxstyleemphasis{mount.s3ql},
and then shares the mountpoint over a network file system like NFS or
CIFS.


\section{What block size should I use?}
\label{\detokenize{faq:what-block-size-should-i-use}}
\sphinxAtStartPar
The \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}data\sphinxhyphen{}block\sphinxhyphen{}size}} option of the \sphinxstyleliteralstrong{\sphinxupquote{mkfs.s3ql}} command determines the maximum
size of the data blocks that S3QL exchanges with the backend server.

\sphinxAtStartPar
For files smaller than the block size, this option has no effect. Files larger than the
maximum object size are split into multiple blocks. Whenever you upload or download data
from the backend, this is done in complete blocks. So if you have configured a maximum
object size of 10 MB, and want to read (or write) 5 bytes in a 100 MB file, you will still
download (or upload) roughly 10 MB of data (compression may reduce this amount). If you
decreased the maximum object size to 5 MB, you’d download/upload only about 5 MB.

\sphinxAtStartPar
On the other hand, if you want to read the whole 100 MB, and have
configured a block size of 10 MB, S3QL will have to send 10 separate
requests to the backend. With a maximum object size of 1 MB, there’d
be 100 separate requests. The larger the number of requests, the more
inefficient this becomes, because there is a fixed time associated
with the processing of each request. Also, many storage providers
charge a fixed amount for each request, so downloading 100 MB in one
request of 100 MB is cheaper than downloading it with 100 requests of
1 MB.

\sphinxAtStartPar
When choosing a block size, you have to find a balance
between these two effects. The bigger the size, the less requests will
be used, but the more data is transferred uselessly. The smaller the
size, the more requests will be used, but less traffic will be wasted.

\sphinxAtStartPar
Generally you should go with the default unless you have a good reason
to change it. When adjusting the value, keep in mind that it only
affects files larger than the block size. For example, if most of your
files are less than 1 MB, decreasing the block size from the
default 10 MB to 1 MB will have almost no effect.


\section{Is there a way to access the file system offline?}
\label{\detokenize{faq:is-there-a-way-to-access-the-file-system-offline}}
\sphinxAtStartPar
No, there is no way to do this. However, for most use\sphinxhyphen{}cases this
feature is actually not required. If you want to ensure that all data
in a directory is stored in the cloud \sphinxstyleemphasis{and} available offline, all you
need to do is store your data in a local directory that you
periodically synchronize to an S3QL mountpoint. For example, if you
would like to have an S3QL mountpoint with persistent cache at
\sphinxcode{\sphinxupquote{/mnt/data}}, you get can this as follows:
\begin{enumerate}
\sphinxsetlistlabels{\arabic}{enumi}{enumii}{}{.}%
\item {} 
\sphinxAtStartPar
Mount a local block device at \sphinxcode{\sphinxupquote{/mnt/data}}.

\item {} 
\sphinxAtStartPar
Mount an S3QL file system at \sphinxcode{\sphinxupquote{/mnt/data\_online}} using a small
cache size and number of threads (eg. \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}threads
2 \sphinxhyphen{}\sphinxhyphen{}max\sphinxhyphen{}cache\sphinxhyphen{}entries 10}}).

\item {} 
\sphinxAtStartPar
Keep \sphinxcode{\sphinxupquote{/mnt/data\_online}} synchronized with \sphinxcode{\sphinxupquote{/mnt/data}}
by either
\begin{itemize}
\item {} 
\sphinxAtStartPar
Periodically running rsync, e.g. by calling
\sphinxcode{\sphinxupquote{rsync \sphinxhyphen{}aHA \sphinxhyphen{}\sphinxhyphen{}delete\sphinxhyphen{}during \sphinxhyphen{}\sphinxhyphen{}partial}} from cron, or

\item {} 
\sphinxAtStartPar
Continuously synchronizing using e.g. \sphinxhref{https://github.com/drunomics/syncd/blob/master/watch.sh}{watch.sh} or
\sphinxhref{https://code.google.com/p/lsyncd/}{lsyncd} (these programs use
\sphinxstyleemphasis{inotify} to constantly monitor the source directory and
immediately copy over any changes)

\end{itemize}

\item {} 
\sphinxAtStartPar
Now use \sphinxcode{\sphinxupquote{/mnt/data}} in the same way as you would use an S3QL
file system with a persistent cache.

\end{enumerate}

\sphinxstepscope


\chapter{Known Issues}
\label{\detokenize{issues:known-issues}}\label{\detokenize{issues::doc}}\begin{itemize}
\item {} 
\sphinxAtStartPar
S3QL de\sphinxhyphen{}duplicates data blocks based solely only on SHA256
checksums, without doing a byte\sphinxhyphen{}by\sphinxhyphen{}byte comparison of the data.
Since it is possible for two data blocks to have the same checksum
despite having different contents, this can lead to problems. If two
such blocks are stored in an S3QL file system, the data in one block
will be lost and replaced by the data in the other block. However,
the chances of this occurring for any two blocks are about 1 in 10\textasciicircum{}77
(2\textasciicircum{}256). For a file system that holds a total of 10\textasciicircum{}34 blocks, the
chances of a collision increase to about 1 in 10\textasciicircum{}9. Storing more
than 10\textasciicircum{}34 blocks (or about 10\textasciicircum{}25 TB with an (extremely small) block
size of 4 kB) is therefore not recommended. Being exceptionally
unlucky may also be a disadvantage.

\item {} 
\sphinxAtStartPar
S3QL does not support Access Control Lists (ACLs). There is nothing
fundamentally that prevents this, someone just has to write the
necessary code.

\item {} 
\sphinxAtStartPar
As of Linux kernel 3.5 S3QL file systems do not implement the “write
protect” bit on directories. In other words, even if a directory has
the write protect bit set, the owner of the directory can delete any
files and (empty) subdirectories inside it. This is a bug in the
FUSE kernel module
(cf. \sphinxurl{https://github.com/libfuse/libfuse/issues/23}) and needs to be
fixed in the kernel.  Unfortunately it does not look as if this is
going to be fixed anytime soon (as of 2016/2/28).

\item {} 
\sphinxAtStartPar
S3QL always updates file and directory access times as if the \sphinxcode{\sphinxupquote{relatime}}
mount option has been specified: the access time (“atime”) is only updated
if it is currently earlier than either the status change time
(“ctime”) or modification time (“mtime”).

\item {} 
\sphinxAtStartPar
S3QL directories always have an \sphinxcode{\sphinxupquote{st\_nlink}} value of 1. This may confuse
programs that rely on directories having \sphinxcode{\sphinxupquote{st\_nlink}} values of \sphinxstyleemphasis{(2 +
number of sub directories)}.

\sphinxAtStartPar
Note that this is not a bug in S3QL. Including sub directories in
the \sphinxcode{\sphinxupquote{st\_nlink}} value is a Unix convention, but by no means a
requirement. If an application blindly relies on this convention
being followed, then this is a bug in the application.

\sphinxAtStartPar
A prominent example are early versions of GNU find, which required
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}noleaf}} option to work correctly on S3QL file systems. This
bug has already been fixed in recent find versions.

\item {} 
\sphinxAtStartPar
The \sphinxcode{\sphinxupquote{umount}} and \sphinxcode{\sphinxupquote{fusermount \sphinxhyphen{}u}} commands will \sphinxstyleemphasis{not} block until all
data has been uploaded to the backend. (this is a FUSE limitation,
cf. \sphinxurl{https://github.com/libfuse/libfuse/issues/1}). If you use either
command to unmount an S3QL file system, you have to take care to
explicitly wait for the \sphinxcode{\sphinxupquote{mount.s3ql}} process to terminate before you
shut down or restart the system. Therefore it is generally not a
good idea to mount an S3QL file system in \sphinxcode{\sphinxupquote{/etc/fstab}} (you should
use a dedicated init script instead).

\item {} 
\sphinxAtStartPar
S3QL relies on the backends not to run out of space. This is a given
for big storage providers like Amazon S3 or Google Storage, but you
may stumble upon this if you use your own server or smaller providers.

\sphinxAtStartPar
If there is no space left in the backend, attempts to write more
data into the S3QL file system will fail and the file system will be
in an inconsistent state and require a file system check (and you
should make sure to make space available in the backend before
running the check).

\sphinxAtStartPar
Unfortunately, there is no way to handle insufficient space in the
backend without leaving the file system inconsistent. Since
S3QL first writes data into the cache, it can no longer return an
error when it later turns out that the cache can not be committed to
the backend.

\end{itemize}

\sphinxstepscope


\chapter{Manpages}
\label{\detokenize{man/index:manpages}}\label{\detokenize{man/index::doc}}
\sphinxAtStartPar
The man pages are installed with S3QL on your system and can be viewed
with the \sphinxstyleliteralstrong{\sphinxupquote{man}} command. For reference, they are also included
here in the User’s Guide.

\sphinxstepscope


\section{The \sphinxstyleliteralstrong{\sphinxupquote{mkfs.s3ql}} command}
\label{\detokenize{man/mkfs:the-command-command}}\label{\detokenize{man/mkfs::doc}}

\subsection{Synopsis}
\label{\detokenize{man/mkfs:synopsis}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{mkfs.s3ql }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}storage url\PYGZgt{}}
\end{sphinxVerbatim}


\subsection{Description}
\label{\detokenize{man/mkfs:description}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{mkfs.s3ql}} command creates a new file system in the location
specified by \sphinxstyleemphasis{storage url}. The format of the storage url depends on the backend
that is used. The S3QL User’s Guide should be consulted for a
description of the available backends.

\sphinxAtStartPar
Unless you have specified the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}plain}} option, \sphinxcode{\sphinxupquote{mkfs.s3ql}} will ask
you to enter an encryption password. This password will \sphinxstyleemphasis{not} be read
from an authentication file specified with the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}authfile}}
option to prevent accidental creation of an encrypted file system.


\subsection{Options}
\label{\detokenize{man/mkfs:options}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{mkfs.s3ql}} command accepts the following options.
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}cachedir \textless{}path\textgreater{}]  
\sphinxAtStartPar
Store cached data in this directory (default:
\sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql)}}
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{None}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}backend\sphinxhyphen{}options \textless{}options\textgreater{}]  
\sphinxAtStartPar
Backend specific options (separate by commas). See
backend documentation for available options.
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\item [\sphinxhyphen{}\sphinxhyphen{}authfile \textless{}path\textgreater{}]  
\sphinxAtStartPar
Read authentication credentials from this file
(default: \sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql/authinfo2)}}
\item [\sphinxhyphen{}L \textless{}name\textgreater{}]  
\sphinxAtStartPar
Filesystem label
\item [\sphinxhyphen{}\sphinxhyphen{}data\sphinxhyphen{}block\sphinxhyphen{}size \textless{}size\textgreater{}]  
\sphinxAtStartPar
Block size (in KiB) to use for storing file contents.
Files larger than this size will be stored in multiple
backend objects. Backend object size may be smaller
than this due to compression. Default: 1024 KiB.
\item [\sphinxhyphen{}\sphinxhyphen{}metadata\sphinxhyphen{}block\sphinxhyphen{}size \textless{}size\textgreater{}]  
\sphinxAtStartPar
Block size (in KiB) to use for storing filesystem
metadata. Backend object size may be smaller than this
due to compression. Default: 64 KiB.
\item [\sphinxhyphen{}\sphinxhyphen{}plain]  
\sphinxAtStartPar
Create unencrypted file system.
\end{optionlist}
\end{quote}


\subsection{Exit Codes}
\label{\detokenize{man/mkfs:exit-codes}}
\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{mkfs.s3ql}} may terminate with the following exit codes:
\begin{quote}\begin{description}
\sphinxlineitem{0}
\sphinxAtStartPar
Everything went well.

\sphinxlineitem{1}
\sphinxAtStartPar
An unexpected error occurred. This may indicate a bug in the
program.

\sphinxlineitem{2}
\sphinxAtStartPar
Invalid command line argument or configuration file key.

\end{description}\end{quote}
\begin{quote}\begin{description}
\sphinxlineitem{3}
\sphinxAtStartPar
Invalid backend option.

\sphinxlineitem{11}
\sphinxAtStartPar
No such backend.

\sphinxlineitem{12}
\sphinxAtStartPar
Authentication file has insecure permissions.

\sphinxlineitem{13}
\sphinxAtStartPar
Unable to parse proxy settings.

\sphinxlineitem{14}
\sphinxAtStartPar
Invalid credentials (Authentication failed).

\sphinxlineitem{15}
\sphinxAtStartPar
No permission to access backend (Authorization denied).

\sphinxlineitem{16}
\sphinxAtStartPar
Invalid storage URL, specified location does not exist in backend.

\sphinxlineitem{19}
\sphinxAtStartPar
Unable to connect to backend, can’t resolve hostname.

\sphinxlineitem{45}
\sphinxAtStartPar
Unable to access cache directory.

\end{description}\end{quote}


\subsection{See Also}
\label{\detokenize{man/mkfs:see-also}}
\sphinxAtStartPar
The S3QL homepage is at \sphinxurl{https://github.com/s3ql/s3ql/}.

\sphinxAtStartPar
The full S3QL documentation should also be installed somewhere on your
system, common locations are \sphinxcode{\sphinxupquote{/usr/share/doc/s3ql}} or
\sphinxcode{\sphinxupquote{/usr/local/doc/s3ql}}.

\sphinxstepscope


\section{The \sphinxstyleliteralstrong{\sphinxupquote{s3qladm}} command}
\label{\detokenize{man/adm:the-command-command}}\label{\detokenize{man/adm::doc}}

\subsection{Synopsis}
\label{\detokenize{man/adm:synopsis}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qladm }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}action\PYGZgt{}}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}storage url\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
where \sphinxcode{\sphinxupquote{action}} may be either of \sphinxstyleliteralstrong{\sphinxupquote{passphrase}}, \sphinxstyleliteralstrong{\sphinxupquote{restore\sphinxhyphen{}metadata}},
\sphinxstyleliteralstrong{\sphinxupquote{clear}}, \sphinxstyleliteralstrong{\sphinxupquote{recover\sphinxhyphen{}key}} or \sphinxstyleliteralstrong{\sphinxupquote{upgrade}}.


\subsection{Description}
\label{\detokenize{man/adm:description}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3qladm}} command performs various operations on \sphinxstyleemphasis{unmounted} S3QL
file systems. The file system \sphinxstyleemphasis{must not be mounted} when using
\sphinxstyleliteralstrong{\sphinxupquote{s3qladm}} or things will go wrong badly.

\sphinxAtStartPar
The storage url depends on the backend that is used. The S3QL User’s
Guide should be consulted for a description of the available backends.


\subsection{Options}
\label{\detokenize{man/adm:options}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3qladm}} command accepts the following options.
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}authfile \textless{}path\textgreater{}]  
\sphinxAtStartPar
Read authentication credentials from this file
(default: \sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql/authinfo2)}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{None}}
\item [\sphinxhyphen{}\sphinxhyphen{}backend\sphinxhyphen{}options \textless{}options\textgreater{}]  
\sphinxAtStartPar
Backend specific options (separate by commas). See
backend documentation for available options.
\item [\sphinxhyphen{}\sphinxhyphen{}cachedir \textless{}path\textgreater{}]  
\sphinxAtStartPar
Store cached data in this directory (default:
\sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql)}}
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\end{optionlist}
\end{quote}

\sphinxAtStartPar
Hint: run \sphinxcode{\sphinxupquote{s3qladm \textless{}action\textgreater{} \sphinxhyphen{}\sphinxhyphen{}help}} to get help on the additional arguments
that the different actions take.


\subsection{Actions}
\label{\detokenize{man/adm:actions}}
\sphinxAtStartPar
The following actions may be specified. Please consult the S3QL User’s Guide for more
detailed information.
\begin{description}
\sphinxlineitem{passphrase}
\sphinxAtStartPar
Changes the encryption passphrase of the file system.

\sphinxlineitem{restore\sphinxhyphen{}metadata}
\sphinxAtStartPar
Interactively restore backups of the file system metadata.

\sphinxlineitem{clear}
\sphinxAtStartPar
Delete the file system with all the stored data.

\sphinxlineitem{recover\sphinxhyphen{}key}
\sphinxAtStartPar
Recover master encryption key from external backup.

\sphinxlineitem{upgrade}
\sphinxAtStartPar
Upgrade the file system to the newest revision.

\end{description}


\subsection{Exit Codes}
\label{\detokenize{man/adm:exit-codes}}
\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{s3qladm}} may terminate with the following exit codes:
\begin{quote}\begin{description}
\sphinxlineitem{0}
\sphinxAtStartPar
Everything went well.

\sphinxlineitem{1}
\sphinxAtStartPar
An unexpected error occurred. This may indicate a bug in the
program.

\sphinxlineitem{2}
\sphinxAtStartPar
Invalid command line argument or configuration file key.

\end{description}\end{quote}
\begin{quote}\begin{description}
\sphinxlineitem{3}
\sphinxAtStartPar
Invalid backend option.

\sphinxlineitem{10}
\sphinxAtStartPar
Could not open log file for writing.

\sphinxlineitem{11}
\sphinxAtStartPar
No such backend.

\sphinxlineitem{12}
\sphinxAtStartPar
Authentication file has insecure permissions.

\sphinxlineitem{13}
\sphinxAtStartPar
Unable to parse proxy settings.

\sphinxlineitem{14}
\sphinxAtStartPar
Invalid credentials (Authentication failed).

\sphinxlineitem{15}
\sphinxAtStartPar
No permission to access backend (Authorization denied).

\sphinxlineitem{16}
\sphinxAtStartPar
Invalid storage URL, specified location does not exist in backend.

\sphinxlineitem{17}
\sphinxAtStartPar
Wrong file system passphrase.

\sphinxlineitem{18}
\sphinxAtStartPar
No S3QL file system found at given storage URL.

\sphinxlineitem{19}
\sphinxAtStartPar
Unable to connect to backend, can’t resolve hostname.

\sphinxlineitem{45}
\sphinxAtStartPar
Unable to access cache directory.

\end{description}\end{quote}


\subsection{See Also}
\label{\detokenize{man/adm:see-also}}
\sphinxAtStartPar
The S3QL homepage is at \sphinxurl{https://github.com/s3ql/s3ql/}.

\sphinxAtStartPar
The full S3QL documentation should also be installed somewhere on your
system, common locations are \sphinxcode{\sphinxupquote{/usr/share/doc/s3ql}} or
\sphinxcode{\sphinxupquote{/usr/local/doc/s3ql}}.

\sphinxstepscope


\section{The \sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}} command}
\label{\detokenize{man/mount:the-command-command}}\label{\detokenize{man/mount::doc}}

\subsection{Synopsis}
\label{\detokenize{man/mount:synopsis}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{mount.s3ql }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}storage url\PYGZgt{}}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}mount point\PYGZgt{}}
\end{sphinxVerbatim}


\subsection{Description}
\label{\detokenize{man/mount:description}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}} command mounts the S3QL file system stored in \sphinxstyleemphasis{storage
url} in the directory \sphinxstyleemphasis{mount point}. The format of the storage url depends on the
backend that is used. The S3QL User’s Guide should be consulted for a
description of the available backends.


\subsection{Options}
\label{\detokenize{man/mount:options}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}} command accepts the following options.
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql/mount.log}}
\item [\sphinxhyphen{}\sphinxhyphen{}cachedir \textless{}path\textgreater{}]  
\sphinxAtStartPar
Store cached data in this directory (default:
\sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql)}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}backend\sphinxhyphen{}options \textless{}options\textgreater{}]  
\sphinxAtStartPar
Backend specific options (separate by commas). See
backend documentation for available options.
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\item [\sphinxhyphen{}\sphinxhyphen{}authfile \textless{}path\textgreater{}]  
\sphinxAtStartPar
Read authentication credentials from this file
(default: \sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql/authinfo2)}}
\item [\sphinxhyphen{}\sphinxhyphen{}compress \textless{}algorithm\sphinxhyphen{}lvl\textgreater{}]  
\sphinxAtStartPar
Compression algorithm and compression level to use
when storing new data. \sphinxstyleemphasis{algorithm} may be any of
\sphinxcode{\sphinxupquote{lzma}}, \sphinxcode{\sphinxupquote{bzip2}}, \sphinxcode{\sphinxupquote{zlib}}, or none. \sphinxstyleemphasis{lvl} may be any
integer from 0 (fastest) to 9 (slowest). Default:
\sphinxcode{\sphinxupquote{lzma\sphinxhyphen{}6}}
\item [\sphinxhyphen{}\sphinxhyphen{}cachesize \textless{}size\textgreater{}]  
\sphinxAtStartPar
Cache size in KiB (default: autodetect).
\item [\sphinxhyphen{}\sphinxhyphen{}max\sphinxhyphen{}cache\sphinxhyphen{}entries \textless{}num\textgreater{}]  
\sphinxAtStartPar
Maximum number of entries in cache (default:
autodetect). Each cache entry requires one file
descriptor, so if you increase this number you have to
make sure that your process file descriptor limit (as
set with \sphinxcode{\sphinxupquote{ulimit \sphinxhyphen{}n}}) is high enough (at least the
number of cache entries + 100).
\item [\sphinxhyphen{}\sphinxhyphen{}keep\sphinxhyphen{}cache]  
\sphinxAtStartPar
Do not purge locally cached files on exit.
\item [\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}other]  
\sphinxAtStartPar
Normally, only the user who called \sphinxcode{\sphinxupquote{mount.s3ql}} can
access the mount point. This user then also has full
access to it, independent of individual file
permissions. If the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}other}} option is
specified, other users can access the mount point as
well and individual file permissions are taken into
account for all users.
\item [\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}root]  
\sphinxAtStartPar
Like \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}other}}, but restrict access to the
mounting user and the root user.
\item [\sphinxhyphen{}\sphinxhyphen{}dirty\sphinxhyphen{}block\sphinxhyphen{}upload\sphinxhyphen{}delay \textless{}seconds\textgreater{}]  
\sphinxAtStartPar
Upload delay for dirty blocks in seconds (default: 10
seconds).
\item [\sphinxhyphen{}\sphinxhyphen{}fg]  
\sphinxAtStartPar
Do not daemonize, stay in foreground
\item [\sphinxhyphen{}\sphinxhyphen{}fs\sphinxhyphen{}name FS\_NAME]  
\sphinxAtStartPar
Mount name passed to fuse, the name will be shown in
the first column of the system mount command output.
If not specified your storage url is used.
\item [\sphinxhyphen{}\sphinxhyphen{}systemd]  
\sphinxAtStartPar
Run as systemd unit. Consider specifying \textendash{}log none as
well to make use of journald.
\item [\sphinxhyphen{}\sphinxhyphen{}metadata\sphinxhyphen{}backup\sphinxhyphen{}interval \textless{}seconds\textgreater{}]  
\sphinxAtStartPar
Interval between metadata backups. Should the
filesystem crash while mounted, modifications made
after the most recent metadata backup may be lost.
During backups, the filesystem will be unresponsile.
Default: 6h
\item [\sphinxhyphen{}\sphinxhyphen{}threads \textless{}no\textgreater{}]  
\sphinxAtStartPar
Number of parallel upload threads to use (default:
auto).
\item [\sphinxhyphen{}\sphinxhyphen{}nfs]  
\sphinxAtStartPar
Enable some optimizations for exporting the file
system over NFS. (default: False)
\end{optionlist}
\end{quote}


\subsection{Exit Codes}
\label{\detokenize{man/mount:exit-codes}}
\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}} may terminate with the following exit codes:
\begin{quote}\begin{description}
\sphinxlineitem{0}
\sphinxAtStartPar
Everything went well.

\sphinxlineitem{1}
\sphinxAtStartPar
An unexpected error occurred. This may indicate a bug in the
program.

\sphinxlineitem{2}
\sphinxAtStartPar
Invalid command line argument or configuration file key.

\end{description}\end{quote}
\begin{quote}\begin{description}
\sphinxlineitem{3}
\sphinxAtStartPar
Invalid backend option.

\sphinxlineitem{10}
\sphinxAtStartPar
Could not open log file for writing.

\sphinxlineitem{11}
\sphinxAtStartPar
No such backend.

\sphinxlineitem{12}
\sphinxAtStartPar
Authentication file has insecure permissions.

\sphinxlineitem{13}
\sphinxAtStartPar
Unable to parse proxy settings.

\sphinxlineitem{14}
\sphinxAtStartPar
Invalid credentials (Authentication failed).

\sphinxlineitem{15}
\sphinxAtStartPar
No permission to access backend (Authorization denied).

\sphinxlineitem{16}
\sphinxAtStartPar
Invalid storage URL, specified location does not exist in backend.

\sphinxlineitem{17}
\sphinxAtStartPar
Wrong file system passphrase.

\sphinxlineitem{18}
\sphinxAtStartPar
No S3QL file system found at given storage URL.

\sphinxlineitem{19}
\sphinxAtStartPar
Unable to connect to backend, can’t resolve hostname.

\sphinxlineitem{30}
\sphinxAtStartPar
File system was not unmounted cleanly.

\sphinxlineitem{31}
\sphinxAtStartPar
File system appears to be mounted elsewhere.

\sphinxlineitem{32}
\sphinxAtStartPar
Unsupported file system revision (too old).

\sphinxlineitem{33}
\sphinxAtStartPar
Unsupported file system revision (too new).

\sphinxlineitem{34}
\sphinxAtStartPar
Insufficient free nodes, need to run \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}}.

\sphinxlineitem{35}
\sphinxAtStartPar
Attempted to mount read\sphinxhyphen{}only, this is not supported.

\sphinxlineitem{36}
\sphinxAtStartPar
Mountpoint does not exist.

\sphinxlineitem{37}
\sphinxAtStartPar
Not enough available file descriptors.

\sphinxlineitem{39}
\sphinxAtStartPar
Unable to bind file system to mountpoint.

\sphinxlineitem{45}
\sphinxAtStartPar
Unable to access cache directory.

\end{description}\end{quote}


\subsection{See Also}
\label{\detokenize{man/mount:see-also}}
\sphinxAtStartPar
The S3QL homepage is at \sphinxurl{https://github.com/s3ql/s3ql/}.

\sphinxAtStartPar
The full S3QL documentation should also be installed somewhere on your
system, common locations are \sphinxcode{\sphinxupquote{/usr/share/doc/s3ql}} or
\sphinxcode{\sphinxupquote{/usr/local/doc/s3ql}}.

\sphinxstepscope


\section{The \sphinxstyleliteralstrong{\sphinxupquote{s3qlstat}} command}
\label{\detokenize{man/stat:the-command-command}}\label{\detokenize{man/stat::doc}}

\subsection{Synopsis}
\label{\detokenize{man/stat:synopsis}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qlstat }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}mountpoint\PYGZgt{}}
\end{sphinxVerbatim}


\subsection{Description}
\label{\detokenize{man/stat:description}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3qlstat}} command prints statistics about the S3QL file system mounted
at \sphinxcode{\sphinxupquote{mountpoint}}.

\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{s3qlstat}} can only be called by the user that mounted the file system
and (if the file system was mounted with \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}other}} or
\sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}root}}) the root user.


\subsection{Options}
\label{\detokenize{man/stat:options}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3qlstat}} command accepts the following options:
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{None}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\item [\sphinxhyphen{}\sphinxhyphen{}raw]  
\sphinxAtStartPar
Do not pretty\sphinxhyphen{}print numbers
\end{optionlist}
\end{quote}


\subsection{Exit Codes}
\label{\detokenize{man/stat:exit-codes}}
\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{s3qlstat}} may terminate with the following exit codes:
\begin{quote}\begin{description}
\sphinxlineitem{0}
\sphinxAtStartPar
Everything went well.

\sphinxlineitem{1}
\sphinxAtStartPar
An unexpected error occurred. This may indicate a bug in the
program.

\sphinxlineitem{2}
\sphinxAtStartPar
Invalid command line argument or configuration file key.

\end{description}\end{quote}


\subsection{See Also}
\label{\detokenize{man/stat:see-also}}
\sphinxAtStartPar
The S3QL homepage is at \sphinxurl{https://github.com/s3ql/s3ql/}.

\sphinxAtStartPar
The full S3QL documentation should also be installed somewhere on your
system, common locations are \sphinxcode{\sphinxupquote{/usr/share/doc/s3ql}} or
\sphinxcode{\sphinxupquote{/usr/local/doc/s3ql}}.

\sphinxstepscope


\section{The \sphinxstyleliteralstrong{\sphinxupquote{s3qlctrl}} command}
\label{\detokenize{man/ctrl:the-command-command}}\label{\detokenize{man/ctrl::doc}}

\subsection{Synopsis}
\label{\detokenize{man/ctrl:synopsis}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qlctrl }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}action\PYGZgt{}}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}mountpoint\PYGZgt{}}\PYG{l}{ ...}
\end{sphinxVerbatim}

\sphinxAtStartPar
where \sphinxcode{\sphinxupquote{action}} may be either of \sphinxstyleliteralstrong{\sphinxupquote{flushcache}}, \sphinxstyleliteralstrong{\sphinxupquote{dropcache}},
\sphinxstyleliteralstrong{\sphinxupquote{log}}, \sphinxstyleliteralstrong{\sphinxupquote{cachesize}} or \sphinxstyleliteralstrong{\sphinxupquote{backup\sphinxhyphen{}metadata}}.


\subsection{Description}
\label{\detokenize{man/ctrl:description}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3qlctrl}} command performs various actions on the S3QL file system mounted
in \sphinxcode{\sphinxupquote{mountpoint}}.

\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{s3qlctrl}} can only be called by the user that mounted the file system and (if
the file system was mounted with \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}other}} or \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}root}}) the
root user.

\sphinxAtStartPar
The following actions may be specified:
\begin{quote}
\begin{quote}\begin{description}
\sphinxlineitem{flushcache}
\sphinxAtStartPar
Write all modified blocks to the backend. The command blocks until the
cache is clean.

\sphinxlineitem{dropcache}
\sphinxAtStartPar
Flush the filesystem cache and then drop all contents (i.e., make the cache
empty).

\sphinxlineitem{log}
\sphinxAtStartPar
Change the amount of information that is logged. The complete syntax is:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qlctrl }\PYG{g+ge}{[options]}\PYG{l}{ log }\PYG{n+nv}{\PYGZlt{}mountpoint\PYGZgt{}}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}level\PYGZgt{}}\PYG{l}{ }\PYG{g+ge}{[\PYGZlt{}module\PYGZgt{} ...]}
\end{sphinxVerbatim}

\sphinxAtStartPar
here \sphinxcode{\sphinxupquote{level}} is the desired new log level and may be either of \sphinxstyleemphasis{debug},
\sphinxstyleemphasis{info} or \sphinxstyleemphasis{warn}. One or more \sphinxcode{\sphinxupquote{module}} may only be specified with the
\sphinxstyleemphasis{debug} level and allow to restrict the debug output to just the listed
modules.

\sphinxlineitem{cachesize}
\sphinxAtStartPar
Changes the cache size of the file
system. This action requires an additional argument that specifies the new
cache size in KiB, so the complete command line is:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qlctrl }\PYG{g+ge}{[options]}\PYG{l}{ cachesize }\PYG{n+nv}{\PYGZlt{}mountpoint\PYGZgt{}}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}new\PYGZhy{}cache\PYGZhy{}size\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxlineitem{backup\sphinxhyphen{}metadata}
\sphinxAtStartPar
Trigger a metadata backup.

\end{description}\end{quote}
\end{quote}


\subsection{Options}
\label{\detokenize{man/ctrl:options}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3qlctrl}} command also accepts the following options, no matter
what specific action is being invoked:
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{None}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\end{optionlist}
\end{quote}

\sphinxAtStartPar
Hint: run \sphinxcode{\sphinxupquote{s3qlctrl \textless{}action\textgreater{} \sphinxhyphen{}\sphinxhyphen{}help}} to get help on the additional arguments
that the different actions take.


\subsection{Exit Codes}
\label{\detokenize{man/ctrl:exit-codes}}
\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{s3qlctrl}} may terminate with the following exit codes:
\begin{quote}\begin{description}
\sphinxlineitem{0}
\sphinxAtStartPar
Everything went well.

\sphinxlineitem{1}
\sphinxAtStartPar
An unexpected error occurred. This may indicate a bug in the
program.

\sphinxlineitem{2}
\sphinxAtStartPar
Invalid command line argument or configuration file key.

\end{description}\end{quote}


\subsection{See Also}
\label{\detokenize{man/ctrl:see-also}}
\sphinxAtStartPar
The S3QL homepage is at \sphinxurl{https://github.com/s3ql/s3ql/}.

\sphinxAtStartPar
The full S3QL documentation should also be installed somewhere on your
system, common locations are \sphinxcode{\sphinxupquote{/usr/share/doc/s3ql}} or
\sphinxcode{\sphinxupquote{/usr/local/doc/s3ql}}.

\sphinxstepscope


\section{The \sphinxstyleliteralstrong{\sphinxupquote{s3qlcp}} command}
\label{\detokenize{man/cp:the-command-command}}\label{\detokenize{man/cp::doc}}

\subsection{Synopsis}
\label{\detokenize{man/cp:synopsis}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qlcp }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}source\PYGZhy{}dir\PYGZgt{}}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}dest\PYGZhy{}dir\PYGZgt{}}
\end{sphinxVerbatim}


\subsection{Description}
\label{\detokenize{man/cp:description}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3qlcp}} command duplicates the directory tree \sphinxcode{\sphinxupquote{source\sphinxhyphen{}dir}}
into \sphinxcode{\sphinxupquote{dest\sphinxhyphen{}dir}} without physically copying the file contents.
Both source and destination must lie inside the same S3QL file system.

\sphinxAtStartPar
The replication will not take any additional space for the file contents. Metadata usage
will increase proportional to the amount of directory entries and inodes. Only if one of
directories is modified later on, the modified data will take additional storage space.

\sphinxAtStartPar
\sphinxcode{\sphinxupquote{s3qlcp}} can only be called by the user that mounted the file system
and (if the file system was mounted with \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}other}} or \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}root}})
the root user.

\sphinxAtStartPar
After the replication, both source and target directory will still be completely ordinary
directories. You can regard \sphinxcode{\sphinxupquote{\textless{}src\textgreater{}}} as a snapshot of \sphinxcode{\sphinxupquote{\textless{}target\textgreater{}}} or vice versa. However,
the most common usage of \sphinxcode{\sphinxupquote{s3qlcp}} is to regularly duplicate the same source directory, say
\sphinxcode{\sphinxupquote{documents}}, to different target directories. For a e.g. monthly replication, the target
directories would typically be named something like \sphinxcode{\sphinxupquote{documents\_January}} for the
replication in January, \sphinxcode{\sphinxupquote{documents\_February}} for the replication in February etc.  In this
case it is clear that the target directories should be regarded as snapshots of the source
directory.

\sphinxAtStartPar
Exactly the same effect could be achieved by an ordinary copy program like \sphinxcode{\sphinxupquote{cp
\sphinxhyphen{}a}}. However, this procedure would be orders of magnitude slower, because \sphinxcode{\sphinxupquote{cp}} would have
to read every file completely (so that S3QL had to fetch all the data over the network
from the backend) before writing them into the destination folder (at which point S3QL
would de\sphinxhyphen{}duplicate the data).


\subsubsection{Snapshotting vs Hardlinking}
\label{\detokenize{man/cp:snapshotting-vs-hardlinking}}
\sphinxAtStartPar
Snapshot support in S3QL is inspired by the hardlinking feature that
is offered by programs like \sphinxhref{http://www.samba.org/rsync}{rsync} or
\sphinxhref{http://savannah.nongnu.org/projects/storebackup}{storeBackup}.
These programs can create a hardlink instead of copying a file if an
identical file already exists in the backup. However, using hardlinks
has disadvantages:
\begin{itemize}
\item {} 
\sphinxAtStartPar
backups and restores always have to be made with a special program
that takes care of the hardlinking. The backups must not be touched
by any other programs (they may make changes that inadvertently
affect other hardlinked files)

\item {} 
\sphinxAtStartPar
special care needs to be taken to handle files which are already
hardlinked (the restore program needs to know that the hardlink was
not introduced by the backup program)

\end{itemize}

\sphinxAtStartPar
S3QL snapshots do not have these problems, and they can be used with
any backup program.


\subsection{Options}
\label{\detokenize{man/cp:options}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3qlcp}} command accepts the following options:
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{None}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\end{optionlist}
\end{quote}


\subsection{Exit Codes}
\label{\detokenize{man/cp:exit-codes}}
\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{s3qlcp}} may terminate with the following exit codes:
\begin{quote}\begin{description}
\sphinxlineitem{0}
\sphinxAtStartPar
Everything went well.

\sphinxlineitem{1}
\sphinxAtStartPar
An unexpected error occurred. This may indicate a bug in the
program.

\sphinxlineitem{2}
\sphinxAtStartPar
Invalid command line argument or configuration file key.

\end{description}\end{quote}


\subsection{See Also}
\label{\detokenize{man/cp:see-also}}
\sphinxAtStartPar
The S3QL homepage is at \sphinxurl{https://github.com/s3ql/s3ql/}.

\sphinxAtStartPar
The full S3QL documentation should also be installed somewhere on your
system, common locations are \sphinxcode{\sphinxupquote{/usr/share/doc/s3ql}} or
\sphinxcode{\sphinxupquote{/usr/local/doc/s3ql}}.

\sphinxstepscope


\section{The \sphinxstyleliteralstrong{\sphinxupquote{s3qlrm}} command}
\label{\detokenize{man/rm:the-command-command}}\label{\detokenize{man/rm::doc}}

\subsection{Synopsis}
\label{\detokenize{man/rm:synopsis}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qlrm }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}directory\PYGZgt{}}
\end{sphinxVerbatim}


\subsection{Description}
\label{\detokenize{man/rm:description}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3qlrm}} command recursively deletes files and directories on an S3QL file
system. Although \sphinxstyleliteralstrong{\sphinxupquote{s3qlrm}} is faster than using e.g.  \sphinxstyleliteralstrong{\sphinxupquote{rm \sphinxhyphen{}r}}, the main reason
for its existence is that it allows you to delete immutable trees (which can be created
with \sphinxstyleliteralstrong{\sphinxupquote{s3qllock}}) as well.

\sphinxAtStartPar
Be warned that there is no additional confirmation. The directory will
be removed entirely and immediately.

\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{s3qlrm}} can only be called by the user that mounted the file system
and (if the file system was mounted with \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}other}} or
\sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}root}}) the root user.


\subsection{Options}
\label{\detokenize{man/rm:options}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3qlrm}} command accepts the following options:
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{None}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\end{optionlist}
\end{quote}


\subsection{Exit Codes}
\label{\detokenize{man/rm:exit-codes}}
\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{s3qlrm}} may terminate with the following exit codes:
\begin{quote}\begin{description}
\sphinxlineitem{0}
\sphinxAtStartPar
Everything went well.

\sphinxlineitem{1}
\sphinxAtStartPar
An unexpected error occurred. This may indicate a bug in the
program.

\sphinxlineitem{2}
\sphinxAtStartPar
Invalid command line argument or configuration file key.

\end{description}\end{quote}


\subsection{See Also}
\label{\detokenize{man/rm:see-also}}
\sphinxAtStartPar
The S3QL homepage is at \sphinxurl{https://github.com/s3ql/s3ql/}.

\sphinxAtStartPar
The full S3QL documentation should also be installed somewhere on your
system, common locations are \sphinxcode{\sphinxupquote{/usr/share/doc/s3ql}} or
\sphinxcode{\sphinxupquote{/usr/local/doc/s3ql}}.

\sphinxstepscope


\section{The \sphinxstyleliteralstrong{\sphinxupquote{s3qllock}} command}
\label{\detokenize{man/lock:the-command-command}}\label{\detokenize{man/lock::doc}}

\subsection{Synopsis}
\label{\detokenize{man/lock:synopsis}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3qllock }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}directory\PYGZgt{}}
\end{sphinxVerbatim}


\subsection{Description}
\label{\detokenize{man/lock:description}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3qllock}} command makes a directory tree in an S3QL file
system immutable. Immutable trees can no longer be changed in any way
whatsoever. You can not add new files or directories and you can not
change or delete existing files and directories. The only way to get
rid of an immutable tree is to use the \sphinxstyleliteralstrong{\sphinxupquote{s3qlrm}} command.

\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{s3qllock}} can only be called by the user that mounted the file system
and (if the file system was mounted with \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}other}} or
\sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}allow\sphinxhyphen{}root}}) the root user.


\subsection{Rationale}
\label{\detokenize{man/lock:rationale}}
\sphinxAtStartPar
Immutability is a feature designed for backups. Traditionally, backups have been made on
external tape drives. Once a backup was made, the tape drive was removed and locked away
somewhere. This means that the contents of the backup are permanently fixed. Nothing
(short of physical destruction) can change or delete files in the backup.

\sphinxAtStartPar
In contrast, when backing up into an online storage system like S3QL,
all backups are available every time the file system is mounted.
Nothing prevents a file in an old backup from being changed again
later on. In the worst case, this may make your entire backup system
worthless. Imagine that your system gets infected by a virus
that simply deletes all files it can find \textendash{} if the virus is active
while the backup file system is mounted, the virus will destroy all
backups together with the originals.

\sphinxAtStartPar
Even in the absence of malware,, being able to change a backup after it has been made is
generally not a good idea. A common S3QL use case is to keep the file system mounted at
all times and periodically create backups with \sphinxstyleliteralstrong{\sphinxupquote{rsync \sphinxhyphen{}a}}. This allows every user
to recover her files from a backup without having to call the system
administrator. However, this also allows every user to accidentally change or delete files
\sphinxstyleemphasis{in} one of the old backups.

\sphinxAtStartPar
Making a backup immutable protects you against all these problems.
Unless you happen to run into a virus that was specifically programmed
to attack S3QL file systems, backups can be neither deleted nor
changed after they have been made immutable.


\subsection{Options}
\label{\detokenize{man/lock:options}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3qllock}} command accepts the following options:
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{None}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\end{optionlist}
\end{quote}


\subsection{Exit Codes}
\label{\detokenize{man/lock:exit-codes}}
\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{s3qllock}} may terminate with the following exit codes:
\begin{quote}\begin{description}
\sphinxlineitem{0}
\sphinxAtStartPar
Everything went well.

\sphinxlineitem{1}
\sphinxAtStartPar
An unexpected error occurred. This may indicate a bug in the
program.

\sphinxlineitem{2}
\sphinxAtStartPar
Invalid command line argument or configuration file key.

\end{description}\end{quote}


\subsection{See Also}
\label{\detokenize{man/lock:see-also}}
\sphinxAtStartPar
The S3QL homepage is at \sphinxurl{https://github.com/s3ql/s3ql/}.

\sphinxAtStartPar
The full S3QL documentation should also be installed somewhere on your
system, common locations are \sphinxcode{\sphinxupquote{/usr/share/doc/s3ql}} or
\sphinxcode{\sphinxupquote{/usr/local/doc/s3ql}}.

\sphinxstepscope


\section{The \sphinxstyleliteralstrong{\sphinxupquote{umount.s3ql}} command}
\label{\detokenize{man/umount:the-command-command}}\label{\detokenize{man/umount::doc}}

\subsection{Synopsis}
\label{\detokenize{man/umount:synopsis}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{umount.s3ql }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}mount point\PYGZgt{}}
\end{sphinxVerbatim}


\subsection{Description}
\label{\detokenize{man/umount:description}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{umount.s3ql}} command unmounts the S3QL file system mounted in the
directory \sphinxstyleemphasis{mount point} and blocks until all data has been uploaded to
the storage backend.

\sphinxAtStartPar
Only the user who mounted the file system with \sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}}
is able to unmount it with \sphinxstyleliteralstrong{\sphinxupquote{umount.s3ql}}. If you are root and want to
unmount an S3QL file system mounted by an ordinary user, you have to
use the \sphinxstyleliteralstrong{\sphinxupquote{fusermount \sphinxhyphen{}u}} or \sphinxstyleliteralstrong{\sphinxupquote{umount}} command instead.
Note that these commands do not block until all data has been
uploaded, so if you use them instead of \sphinxstyleliteralstrong{\sphinxupquote{umount.s3ql}} then
you should manually wait for the \sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}} process to
terminate before shutting down the system.


\subsection{Options}
\label{\detokenize{man/umount:options}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{umount.s3ql}} command accepts the following options.
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{None}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\item [\sphinxhyphen{}\sphinxhyphen{}lazy, \sphinxhyphen{}z]  
\sphinxAtStartPar
Lazy umount. Detaches the file system immediately,
even if there are still open files. The data will be
uploaded in the background once all open files have
been closed.
\end{optionlist}
\end{quote}


\subsection{Exit Codes}
\label{\detokenize{man/umount:exit-codes}}
\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{umount.s3ql}} may terminate with the following exit codes:
\begin{quote}\begin{description}
\sphinxlineitem{0}
\sphinxAtStartPar
Everything went well.

\sphinxlineitem{1}
\sphinxAtStartPar
An unexpected error occurred. This may indicate a bug in the
program.

\sphinxlineitem{2}
\sphinxAtStartPar
Invalid command line argument or configuration file key.

\end{description}\end{quote}


\subsection{See Also}
\label{\detokenize{man/umount:see-also}}
\sphinxAtStartPar
The S3QL homepage is at \sphinxurl{https://github.com/s3ql/s3ql/}.

\sphinxAtStartPar
The full S3QL documentation should also be installed somewhere on your
system, common locations are \sphinxcode{\sphinxupquote{/usr/share/doc/s3ql}} or
\sphinxcode{\sphinxupquote{/usr/local/doc/s3ql}}.

\sphinxstepscope


\section{The \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}} command}
\label{\detokenize{man/fsck:the-command-command}}\label{\detokenize{man/fsck::doc}}

\subsection{Synopsis}
\label{\detokenize{man/fsck:synopsis}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{fsck.s3ql }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}storage url\PYGZgt{}}
\end{sphinxVerbatim}


\subsection{Description}
\label{\detokenize{man/fsck:description}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}} command checks the file system in the location specified by \sphinxstyleemphasis{storage url}
for errors and attempts to repair any problems. The format of the storage url depends on
the backend that is used. The S3QL User’s Guide should be consulted for a description of
the available backends.


\subsection{Options}
\label{\detokenize{man/fsck:options}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}} command accepts the following options.
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql/fsck.log}}
\item [\sphinxhyphen{}\sphinxhyphen{}cachedir \textless{}path\textgreater{}]  
\sphinxAtStartPar
Store cached data in this directory (default:
\sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql)}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}backend\sphinxhyphen{}options \textless{}options\textgreater{}]  
\sphinxAtStartPar
Backend specific options (separate by commas). See
backend documentation for available options.
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\item [\sphinxhyphen{}\sphinxhyphen{}authfile \textless{}path\textgreater{}]  
\sphinxAtStartPar
Read authentication credentials from this file
(default: \sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql/authinfo2)}}
\item [\sphinxhyphen{}\sphinxhyphen{}compress \textless{}algorithm\sphinxhyphen{}lvl\textgreater{}]  
\sphinxAtStartPar
Compression algorithm and compression level to use
when storing new data. \sphinxstyleemphasis{algorithm} may be any of
\sphinxcode{\sphinxupquote{lzma}}, \sphinxcode{\sphinxupquote{bzip2}}, \sphinxcode{\sphinxupquote{zlib}}, or none. \sphinxstyleemphasis{lvl} may be any
integer from 0 (fastest) to 9 (slowest). Default:
\sphinxcode{\sphinxupquote{lzma\sphinxhyphen{}6}}
\item [\sphinxhyphen{}\sphinxhyphen{}keep\sphinxhyphen{}cache]  
\sphinxAtStartPar
Do not purge locally cached files on exit.
\item [\sphinxhyphen{}\sphinxhyphen{}batch]  
\sphinxAtStartPar
If user input is required, exit without prompting.
\item [\sphinxhyphen{}\sphinxhyphen{}force]  
\sphinxAtStartPar
Force checking even if file system is marked clean.
\item [\sphinxhyphen{}\sphinxhyphen{}force\sphinxhyphen{}remote]  
\sphinxAtStartPar
Force use of remote metadata even when this would
likely result in data loss.
\end{optionlist}
\end{quote}


\subsection{Exit Codes}
\label{\detokenize{man/fsck:exit-codes}}
\sphinxAtStartPar
If \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}} found any file system errors (no matter if they were
corrected or not), the exit code will be 128 plus one of the codes
listed below. If no errors were found, the following exit codes are
used as\sphinxhyphen{}is:
\begin{quote}\begin{description}
\sphinxlineitem{0}
\sphinxAtStartPar
Everything went well.

\sphinxlineitem{1}
\sphinxAtStartPar
An unexpected error occurred. This may indicate a bug in the
program.

\sphinxlineitem{2}
\sphinxAtStartPar
Invalid command line argument or configuration file key.

\end{description}\end{quote}
\begin{quote}\begin{description}
\sphinxlineitem{3}
\sphinxAtStartPar
Invalid backend option.

\sphinxlineitem{10}
\sphinxAtStartPar
Could not open log file for writing.

\sphinxlineitem{11}
\sphinxAtStartPar
No such backend.

\sphinxlineitem{12}
\sphinxAtStartPar
Authentication file has insecure permissions.

\sphinxlineitem{13}
\sphinxAtStartPar
Unable to parse proxy settings.

\sphinxlineitem{14}
\sphinxAtStartPar
Invalid credentials (Authentication failed).

\sphinxlineitem{15}
\sphinxAtStartPar
No permission to access backend (Authorization denied).

\sphinxlineitem{16}
\sphinxAtStartPar
Invalid storage URL, specified location does not exist in backend.

\sphinxlineitem{17}
\sphinxAtStartPar
Wrong file system passphrase.

\sphinxlineitem{18}
\sphinxAtStartPar
No S3QL file system found at given storage URL.

\sphinxlineitem{19}
\sphinxAtStartPar
Unable to connect to backend, can’t resolve hostname.

\sphinxlineitem{32}
\sphinxAtStartPar
Unsupported file system revision (too old).

\sphinxlineitem{33}
\sphinxAtStartPar
Unsupported file system revision (too new).

\sphinxlineitem{40}
\sphinxAtStartPar
Cannot check mounted file system.

\sphinxlineitem{41}
\sphinxAtStartPar
User input required, but running in batch mode.

\sphinxlineitem{42}
\sphinxAtStartPar
File system check aborted by user.

\sphinxlineitem{43}
\sphinxAtStartPar
Local metadata is corrupted.

\sphinxlineitem{44}
\sphinxAtStartPar
Uncorrectable errors found.

\sphinxlineitem{45}
\sphinxAtStartPar
Unable to access cache directory.

\sphinxlineitem{128}
\sphinxAtStartPar
This error code will be \sphinxstyleemphasis{added} to one of the codes above if any
file system errors have been found (no matter if they were
corrected or not).

\end{description}\end{quote}


\subsection{See Also}
\label{\detokenize{man/fsck:see-also}}
\sphinxAtStartPar
The S3QL homepage is at \sphinxurl{https://github.com/s3ql/s3ql/}.

\sphinxAtStartPar
The full S3QL documentation should also be installed somewhere on your
system, common locations are \sphinxcode{\sphinxupquote{/usr/share/doc/s3ql}} or
\sphinxcode{\sphinxupquote{/usr/local/doc/s3ql}}.

\sphinxstepscope


\section{The \sphinxstyleliteralstrong{\sphinxupquote{s3ql\_oauth\_client}} command}
\label{\detokenize{man/oauth_client:the-command-command}}\label{\detokenize{man/oauth_client:oauth-client}}\label{\detokenize{man/oauth_client::doc}}

\subsection{Synopsis}
\label{\detokenize{man/oauth_client:synopsis}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3ql\PYGZus{}oauth\PYGZus{}client }\PYG{g+ge}{[options]}
\end{sphinxVerbatim}


\subsection{Description}
\label{\detokenize{man/oauth_client:description}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3ql\_oauth\_client}} command may be used to obtain OAuth2 authentication
tokens for use with Google Storage. It requests a “user code” from
Google which has to be pasted into the browser to complete the
authentication process interactively. Once authentication in the
browser has been completed, \sphinxstyleliteralstrong{\sphinxupquote{s3ql\_oauth\_client}} displays the OAuth2 refresh
token.

\sphinxAtStartPar
When combined with the special username \sphinxcode{\sphinxupquote{oauth2}}, the refresh token
can be used as a backend passphrase when using the Google Storage S3QL
backend.


\subsection{Options}
\label{\detokenize{man/oauth_client:options}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3ql\_oauth\_client}} command accepts the following options:
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{None}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\end{optionlist}
\end{quote}


\subsection{Exit Codes}
\label{\detokenize{man/oauth_client:exit-codes}}
\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{s3ql\_oauth\_client}} may terminate with the following exit codes:
\begin{quote}\begin{description}
\sphinxlineitem{0}
\sphinxAtStartPar
Everything went well.

\sphinxlineitem{1}
\sphinxAtStartPar
An unexpected error occurred. This may indicate a bug in the
program.

\sphinxlineitem{2}
\sphinxAtStartPar
Invalid command line argument or configuration file key.

\end{description}\end{quote}


\subsection{See Also}
\label{\detokenize{man/oauth_client:see-also}}
\sphinxAtStartPar
The S3QL homepage is at \sphinxurl{https://github.com/s3ql/s3ql/}.

\sphinxAtStartPar
The full S3QL documentation should also be installed somewhere on your
system, common locations are \sphinxcode{\sphinxupquote{/usr/share/doc/s3ql}} or
\sphinxcode{\sphinxupquote{/usr/local/doc/s3ql}}.

\sphinxstepscope


\section{The \sphinxstyleliteralstrong{\sphinxupquote{s3ql\_verify}} command}
\label{\detokenize{man/verify:the-command-command}}\label{\detokenize{man/verify::doc}}

\subsection{Synopsis}
\label{\detokenize{man/verify:synopsis}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{s3ql\PYGZus{}verify }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}storage url\PYGZgt{}}
\end{sphinxVerbatim}


\subsection{Description}
\label{\detokenize{man/verify:description}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3ql\_verify}} command verifies all data in the file system.  In
contrast to \sphinxstyleliteralstrong{\sphinxupquote{fsck.s3ql}}, \sphinxstyleliteralstrong{\sphinxupquote{s3ql\_verify}} does not trust the object
listing returned by the backend, but actually attempts to retrieve
every object. It therefore takes a lot longer.

\sphinxAtStartPar
The format of \sphinxcode{\sphinxupquote{\textless{}storage url\textgreater{}}} depends on the backend that is
used. The S3QL User’s Guide should be consulted for a description of
the available backends.


\subsection{Options}
\label{\detokenize{man/verify:options}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{s3ql\_verify}} command accepts the following options.
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{None}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\item [\sphinxhyphen{}\sphinxhyphen{}cachedir \textless{}path\textgreater{}]  
\sphinxAtStartPar
Store cached data in this directory (default:
\sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql)}}
\item [\sphinxhyphen{}\sphinxhyphen{}backend\sphinxhyphen{}options \textless{}options\textgreater{}]  
\sphinxAtStartPar
Backend specific options (separate by commas). See
backend documentation for available options.
\item [\sphinxhyphen{}\sphinxhyphen{}authfile \textless{}path\textgreater{}]  
\sphinxAtStartPar
Read authentication credentials from this file
(default: \sphinxcode{\sphinxupquote{\textasciitilde{}/.s3ql/authinfo2)}}
\item [\sphinxhyphen{}\sphinxhyphen{}missing\sphinxhyphen{}file \textless{}name\textgreater{}]  
\sphinxAtStartPar
File to store keys of missing objects.
\item [\sphinxhyphen{}\sphinxhyphen{}corrupted\sphinxhyphen{}file \textless{}name\textgreater{}]  
\sphinxAtStartPar
File to store keys of corrupted objects.
\item [\sphinxhyphen{}\sphinxhyphen{}data]  
\sphinxAtStartPar
Read every object completely, instead of checking just
the metadata.
\item [\sphinxhyphen{}\sphinxhyphen{}parallel PARALLEL]  
\sphinxAtStartPar
Number of connections to use in parallel.
\item [\sphinxhyphen{}\sphinxhyphen{}start\sphinxhyphen{}with \textless{}n\textgreater{}]  
\sphinxAtStartPar
Skip over first \textless{}n\textgreater{} objects and with verifying object
\textless{}n\textgreater{}+1.
\end{optionlist}
\end{quote}


\subsection{Exit Codes}
\label{\detokenize{man/verify:exit-codes}}
\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{s3ql\_verify}} may terminate with the following exit codes:
\begin{quote}\begin{description}
\sphinxlineitem{0}
\sphinxAtStartPar
Everything went well.

\sphinxlineitem{1}
\sphinxAtStartPar
An unexpected error occurred. This may indicate a bug in the
program.

\sphinxlineitem{2}
\sphinxAtStartPar
Invalid command line argument or configuration file key.

\end{description}\end{quote}
\begin{quote}\begin{description}
\sphinxlineitem{3}
\sphinxAtStartPar
Invalid backend option.

\sphinxlineitem{10}
\sphinxAtStartPar
Could not open log file for writing.

\sphinxlineitem{11}
\sphinxAtStartPar
No such backend.

\sphinxlineitem{12}
\sphinxAtStartPar
Authentication file has insecure permissions.

\sphinxlineitem{13}
\sphinxAtStartPar
Unable to parse proxy settings.

\sphinxlineitem{14}
\sphinxAtStartPar
Invalid credentials (Authentication failed).

\sphinxlineitem{15}
\sphinxAtStartPar
No permission to access backend (Authorization denied).

\sphinxlineitem{16}
\sphinxAtStartPar
Invalid storage URL, specified location does not exist in backend.

\sphinxlineitem{17}
\sphinxAtStartPar
Wrong file system passphrase.

\sphinxlineitem{18}
\sphinxAtStartPar
No S3QL file system found at given storage URL.

\sphinxlineitem{19}
\sphinxAtStartPar
Unable to connect to backend, can’t resolve hostname.

\sphinxlineitem{32}
\sphinxAtStartPar
Unsupported file system revision (too old).

\sphinxlineitem{33}
\sphinxAtStartPar
Unsupported file system revision (too new).

\sphinxlineitem{45}
\sphinxAtStartPar
Unable to access cache directory.

\sphinxlineitem{46}
\sphinxAtStartPar
The file system data was verified, and some objects were found
to be missing or corrupted.

\end{description}\end{quote}


\subsection{See Also}
\label{\detokenize{man/verify:see-also}}
\sphinxAtStartPar
The S3QL homepage is at \sphinxurl{https://github.com/s3ql/s3ql/}.

\sphinxAtStartPar
The full S3QL documentation should also be installed somewhere on your
system, common locations are \sphinxcode{\sphinxupquote{/usr/share/doc/s3ql}} or
\sphinxcode{\sphinxupquote{/usr/local/doc/s3ql}}.

\sphinxstepscope


\section{The \sphinxstyleliteralstrong{\sphinxupquote{pcp}} command}
\label{\detokenize{man/pcp:the-command-command}}\label{\detokenize{man/pcp::doc}}

\subsection{Synopsis}
\label{\detokenize{man/pcp:synopsis}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{pcp }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}source\PYGZgt{}}\PYG{l}{ }\PYG{g+ge}{[\PYGZlt{}source\PYGZgt{} ...]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}destination\PYGZgt{}}
\end{sphinxVerbatim}


\subsection{Description}
\label{\detokenize{man/pcp:description}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{pcp}} command is a is a wrapper that starts several
\sphinxstyleliteralstrong{\sphinxupquote{sync}} processes to copy directory trees in parallel. This is
allows much better copying performance on file system that have
relatively high latency when retrieving individual files like S3QL.

\sphinxAtStartPar
\sphinxstylestrong{Note}: Using this program only improves performance when copying
\sphinxstyleemphasis{from} an S3QL file system. When copying \sphinxstyleemphasis{to} an S3QL file system,
using \sphinxstyleliteralstrong{\sphinxupquote{pcp}} is more likely to \sphinxstyleemphasis{decrease} performance.


\subsection{Options}
\label{\detokenize{man/pcp:options}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{pcp}} command accepts the following options:
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{None}}
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\item [\sphinxhyphen{}a]  
\sphinxAtStartPar
Pass \sphinxhyphen{}aHAX option to rsync.
\item [\sphinxhyphen{}\sphinxhyphen{}processes \textless{}no\textgreater{}]  
\sphinxAtStartPar
Number of rsync processes to use (default: 10).
\end{optionlist}
\end{quote}


\subsection{Exit Codes}
\label{\detokenize{man/pcp:exit-codes}}
\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{pcp}} may terminate with the following exit codes:
\begin{quote}\begin{description}
\sphinxlineitem{0}
\sphinxAtStartPar
Everything went well.

\sphinxlineitem{1}
\sphinxAtStartPar
An unexpected error occurred. This may indicate a bug in the
program.

\sphinxlineitem{2}
\sphinxAtStartPar
Invalid command line argument or configuration file key.

\end{description}\end{quote}


\subsection{See Also}
\label{\detokenize{man/pcp:see-also}}
\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{pcp}} is shipped as part of S3QL, \sphinxurl{https://github.com/s3ql/s3ql/}.

\sphinxstepscope


\section{The \sphinxstyleliteralstrong{\sphinxupquote{expire\_backups}} command}
\label{\detokenize{man/expire_backups:the-command-command}}\label{\detokenize{man/expire_backups::doc}}

\subsection{Synopsis}
\label{\detokenize{man/expire_backups:synopsis}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{expire\PYGZus{}backups }\PYG{g+ge}{[options]}\PYG{l}{ }\PYG{n+nv}{\PYGZlt{}age\PYGZgt{}}\PYG{l}{ }\PYG{g+ge}{[\PYGZlt{}age\PYGZgt{} ...]}
\end{sphinxVerbatim}


\subsection{Description}
\label{\detokenize{man/expire_backups:description}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{expire\_backups}} command intelligently remove old backups that are no
longer needed.

\sphinxAtStartPar
To define what backups you want to keep for how long, you define a
number of \sphinxstyleemphasis{age ranges}. \sphinxstyleliteralstrong{\sphinxupquote{expire\_backups}} ensures that you
will have at least one backup in each age range at all times. It will
keep exactly as many backups as are required for that and delete any
backups that become redundant.

\sphinxAtStartPar
Age ranges are specified by giving a list of range boundaries in terms
of backup cycles. Every time you create a new backup, the existing
backups age by one cycle.

\sphinxAtStartPar
Example: when \sphinxstyleliteralstrong{\sphinxupquote{expire\_backups}} is called with the age range
definition \sphinxcode{\sphinxupquote{1 3 7 14 31}}, it will guarantee that you always have the
following backups available:
\begin{enumerate}
\sphinxsetlistlabels{\arabic}{enumi}{enumii}{}{.}%
\item {} 
\sphinxAtStartPar
A backup that is 0 to 1 cycles old (i.e, the most recent backup)

\item {} 
\sphinxAtStartPar
A backup that is 1 to 3 cycles old

\item {} 
\sphinxAtStartPar
A backup that is 3 to 7 cycles old

\item {} 
\sphinxAtStartPar
A backup that is 7 to 14 cycles old

\item {} 
\sphinxAtStartPar
A backup that is 14 to 31 cycles old

\end{enumerate}

\begin{sphinxadmonition}{note}{Note:}
\sphinxAtStartPar
If you do backups in fixed intervals, then one cycle will be
equivalent to the backup interval. The advantage of specifying the
age ranges in terms of backup cycles rather than days or weeks is
that it allows you to gracefully handle irregular backup intervals.
Imagine that for some reason you do not turn on your computer for
one month. Now all your backups are at least a month old, and if you
had specified the above backup strategy in terms of absolute ages,
they would all be deleted! Specifying age ranges in terms of backup
cycles avoids these sort of problems.
\end{sphinxadmonition}

\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{expire\_backups}} usage is simple. It requires backups to be
stored in directories of the form \sphinxcode{\sphinxupquote{year\sphinxhyphen{}month\sphinxhyphen{}day\_hour:minute:seconds}}
(\sphinxcode{\sphinxupquote{YYYY\sphinxhyphen{}MM\sphinxhyphen{}DD\_HH:mm:ss}}) and works on all backups in the current
directory. So for the above backup strategy, the correct invocation
would be:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l}{expire\PYGZus{}backups.py 1 3 7 14 31}
\end{sphinxVerbatim}

\sphinxAtStartPar
When storing your backups on an S3QL file system, you probably want to
specify the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}use\sphinxhyphen{}s3qlrm}} option as well. This tells
\sphinxstyleliteralstrong{\sphinxupquote{expire\_backups}} to use the {\hyperref[\detokenize{special:s3qlrm}]{\sphinxcrossref{\DUrole{std,std-ref}{s3qlrm}}}} command to
delete directories.

\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{expire\_backups}} uses a “state file” to keep track which
backups are how many cycles old (since this cannot be inferred from
the dates contained in the directory names). The standard name for
this state file is \sphinxcode{\sphinxupquote{.expire\_backups.dat}}. If this file gets
damaged or deleted, \sphinxstyleliteralstrong{\sphinxupquote{expire\_backups}} no longer knows the ages
of the backups and refuses to work. In this case you can use the
\sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}reconstruct\sphinxhyphen{}state}} option to try to reconstruct the state
from the backup dates. However, the accuracy of this reconstruction
depends strongly on how rigorous you have been with making backups (it
is only completely correct if the time between subsequent backups has
always been exactly the same), so it’s generally a good idea not to
tamper with the state file.


\subsection{Options}
\label{\detokenize{man/expire_backups:options}}
\sphinxAtStartPar
The \sphinxstyleliteralstrong{\sphinxupquote{expire\_backups}} command accepts the following options:
\begin{quote}
\begin{optionlist}{3cm}
\item [\sphinxhyphen{}\sphinxhyphen{}quiet]  
\sphinxAtStartPar
be really quiet
\item [\sphinxhyphen{}\sphinxhyphen{}log \textless{}target\textgreater{}]  
\sphinxAtStartPar
Destination for log messages. Specify \sphinxcode{\sphinxupquote{none}} for
standard output or \sphinxcode{\sphinxupquote{syslog}} for the system logging
daemon. Anything else will be interpreted as a file
name. Log files will be rotated when they reach 1 MiB,
and at most 5 old log files will be kept. Default:
\sphinxcode{\sphinxupquote{None}}
\item [\sphinxhyphen{}\sphinxhyphen{}debug\sphinxhyphen{}modules \textless{}modules\textgreater{}]  
\sphinxAtStartPar
Activate debugging output from specified modules (use
commas to separate multiple modules, ‘all’ for
everything). Debug messages will be written to the
target specified by the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}debug]  
\sphinxAtStartPar
Activate debugging output from all S3QL modules. Debug
messages will be written to the target specified by
the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}log}} option.
\item [\sphinxhyphen{}\sphinxhyphen{}version]  
\sphinxAtStartPar
just print program version and exit
\item [\sphinxhyphen{}\sphinxhyphen{}state \textless{}file\textgreater{}]  
\sphinxAtStartPar
File to save state information in (default:
“.expire\_backups.dat”)
\item [\sphinxhyphen{}n]  
\sphinxAtStartPar
Dry run. Just show which backups would be deleted.
\item [\sphinxhyphen{}p \textless{}N\textgreater{}, \sphinxhyphen{}\sphinxhyphen{}proportion\sphinxhyphen{}delete \textless{}N\textgreater{}]  
\sphinxAtStartPar
Maximum proportion of backups to delete (between 0 and
1, default: 0.5)
\item [\sphinxhyphen{}\sphinxhyphen{}reconstruct\sphinxhyphen{}state]  
\sphinxAtStartPar
Try to reconstruct a missing state file from backup
dates.
\item [\sphinxhyphen{}\sphinxhyphen{}use\sphinxhyphen{}s3qlrm]  
\sphinxAtStartPar
Use \sphinxcode{\sphinxupquote{s3qlrm}} command to delete backups.
\end{optionlist}
\end{quote}


\subsection{Exit Codes}
\label{\detokenize{man/expire_backups:exit-codes}}
\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{expire\_backups}} may terminate with the following exit codes:
\begin{quote}\begin{description}
\sphinxlineitem{0}
\sphinxAtStartPar
Everything went well.

\sphinxlineitem{1}
\sphinxAtStartPar
An unexpected error occurred. This may indicate a bug in the
program.

\sphinxlineitem{2}
\sphinxAtStartPar
Invalid command line argument or configuration file key.

\end{description}\end{quote}


\subsection{See Also}
\label{\detokenize{man/expire_backups:see-also}}
\sphinxAtStartPar
\sphinxstyleliteralstrong{\sphinxupquote{expire\_backups}} is shipped as part of S3QL, \sphinxurl{https://github.com/s3ql/s3ql/}.

\sphinxstepscope


\chapter{Further Resources / Getting Help}
\label{\detokenize{resources:further-resources-getting-help}}\label{\detokenize{resources:resources}}\label{\detokenize{resources::doc}}
\sphinxAtStartPar
If you have questions or problems with S3QL that you weren’t able to
resolve with this manual, you might want to consider the following other resources:
\begin{itemize}
\item {} 
\sphinxAtStartPar
The \sphinxhref{https://github.com/s3ql/s3ql/wiki}{S3QL Wiki}

\item {} 
\sphinxAtStartPar
The \sphinxhref{http://groups.google.com/group/s3ql}{S3QL Mailing List}. You
can subscribe by sending a mail to
\sphinxhref{mailto:s3ql+subscribe@googlegroups.com}{s3ql+subscribe@googlegroups.com}.

\end{itemize}

\sphinxAtStartPar
Please report any bugs you may encounter in the \sphinxhref{https://github.com/s3ql/s3ql/issues}{Issue Tracker}.

\sphinxstepscope


\chapter{Implementation Details}
\label{\detokenize{impl_details:implementation-details}}\label{\detokenize{impl_details:impl-details}}\label{\detokenize{impl_details::doc}}
\sphinxAtStartPar
This section provides some background information on how S3QL works
internally. Reading this section is not necessary to use S3QL.


\section{Metadata Storage}
\label{\detokenize{impl_details:metadata-storage}}
\sphinxAtStartPar
Like most unix filesystems, S3QL has a concept of inodes.

\sphinxAtStartPar
The contents of directory inodes (aka the names and inodes of the
files and sub directories contained in a directory) are stored
directly in an \sphinxhref{http://www.sqlite.org/}{SQLite} database. This database is split into a number
of storage objects that are downloaded when the file
system is mounted and uploaded periodically in the background and when
the file system is unmounted. This has two implications:
\begin{enumerate}
\sphinxsetlistlabels{\arabic}{enumi}{enumii}{}{.}%
\item {} 
\sphinxAtStartPar
The entire file system tree can be read from the
database. Fetching/storing storage objects from/in the storage
backend is only required to access the contents of files (or, more
precisely, inodes). This makes most file system operations very
fast because no data has to be send over the network.

\item {} 
\sphinxAtStartPar
An S3QL filesystem can only be mounted on one computer at a time,
using a single \sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}} process. Otherwise changes made in
one mountpoint will invariably be overwritten when the second mount
point is unmounted.

\end{enumerate}

\sphinxAtStartPar
Sockets, FIFOs and character devices do not need any additional
storage, all information about them is contained in the database.


\section{Data Storage}
\label{\detokenize{impl_details:data-storage}}
\sphinxAtStartPar
The contents of file inodes are split into individual blocks. The
maximum size of a block is specified when the file system is created
and cannot be changed afterwards. Every block is stored as an
individual object in the backend, and the mapping from inodes to
blocks and from blocks to objects is stored in the database.

\sphinxAtStartPar
While the file system is mounted, blocks are cached locally.

\sphinxAtStartPar
Blocks can also be compressed and encrypted before they are stored in
the storage backend. This happens during upload, i.e. the cached data
is unencrypted and uncompressed.

\sphinxAtStartPar
If some files have blocks with identical contents, the blocks will be
stored in the same backend object (i.e., the data is only stored
once).


\section{Data De\sphinxhyphen{}Duplication}
\label{\detokenize{impl_details:data-de-duplication}}
\sphinxAtStartPar
Instead of uploading every block, S3QL first computes a checksum (a
SHA256 hash) to check if an identical blocks has already been stored
in an backend object. If that is the case, the new block will be
linked to the existing object instead of being uploaded.

\sphinxAtStartPar
This procedure is invisible for the user and the contents of the block
can still be changed. If several blocks share a backend object and one
of the blocks is changed, the changed block is automatically stored in
a new object (so that the contents of the other block remain
unchanged).


\section{Caching}
\label{\detokenize{impl_details:caching}}
\sphinxAtStartPar
When an application tries to read or write from a file, S3QL
determines the block that contains the required part of the file and
retrieves it from the backend or creates it if it does not yet exist.
The block is then held in the cache directory. It is committed to S3
when it has not been accessed for more than a few seconds. Blocks are
removed from the cache only when the maximum cache size is reached.

\sphinxAtStartPar
When the file system is unmounted, all modified blocks are written to
the backend and the cache is cleaned.


\section{Encryption}
\label{\detokenize{impl_details:encryption}}
\sphinxAtStartPar
When the file system is created, \sphinxstyleliteralstrong{\sphinxupquote{mkfs.s3ql}} generates a 256 bit
master key by reading from \sphinxcode{\sphinxupquote{/dev/random}}. The master key is
encrypted with the passphrase that is entered by the user, and then
stored with the rest of the file system data. Since the passphrase is
only used to access the master key (which is used to encrypt the
actual file system data), the passphrase can easily be changed.

\sphinxAtStartPar
Data is encrypted with a new session key for each object and each
upload. The session key is generated by appending a nonce to the
master key and then calculating the SHA256 hash. The nonce is
generated by concatenating the object id and the current UTC time as a
32 bit float. The precision of the time is given by the Python \sphinxhref{http://docs.python.org/library/time.html\#time.time}{time()} function and
usually at least 1 millisecond. The SHA256 implementation is included
in the Python standard library.

\sphinxAtStartPar
Once the session key has been calculated, a SHA256 HMAC is calculated
over the data that is to be uploaded. Afterwards, the data is
compressed (unless \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}compress none}} was passed to
\sphinxstyleliteralstrong{\sphinxupquote{mount.s3ql}}) and the HMAC inserted at the beginning. Both HMAC
and compressed data are then encrypted using 256 bit AES in CTR
mode using \sphinxhref{http://www.pycrypto.org/}{PyCrypto}.  Finally, the nonce is
inserted in front of the encrypted data and HMAC, and the packet is
send to the backend as a new S3 object.



\renewcommand{\indexname}{Index}
\printindex
\end{document}