|
| 1 | +# pibackup Exclude File Syntax |
| 2 | + |
| 3 | +Exclude files can be used to remove unnecessary files and directories from the backup image before compression. |
| 4 | + |
| 5 | +Default example file: |
| 6 | + |
| 7 | +```text |
| 8 | +/etc/pibackup/raspberry.exclude |
| 9 | +``` |
| 10 | + |
| 11 | +## Syntax |
| 12 | + |
| 13 | +Each line uses the following format: |
| 14 | + |
| 15 | +```text |
| 16 | +command = /path |
| 17 | +``` |
| 18 | + |
| 19 | +Lines starting with `#` are comments. |
| 20 | + |
| 21 | +The placeholder: |
| 22 | + |
| 23 | +```text |
| 24 | +§user |
| 25 | +``` |
| 26 | + |
| 27 | +is automatically replaced with the current username. |
| 28 | + |
| 29 | +--- |
| 30 | + |
| 31 | +## Available Commands |
| 32 | + |
| 33 | +### RF = Remove File |
| 34 | + |
| 35 | +Removes a single file. |
| 36 | + |
| 37 | +Example: |
| 38 | + |
| 39 | +```text |
| 40 | +rf = /home/§user/.bash_history |
| 41 | +``` |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +### RD = Remove Directory |
| 46 | + |
| 47 | +Removes an empty directory. |
| 48 | + |
| 49 | +Example: |
| 50 | + |
| 51 | +```text |
| 52 | +rd = /home/§user/emptyfolder |
| 53 | +``` |
| 54 | + |
| 55 | +--- |
| 56 | + |
| 57 | +### RT = Remove Tree |
| 58 | + |
| 59 | +Removes a directory and everything inside it. |
| 60 | + |
| 61 | +Example: |
| 62 | + |
| 63 | +```text |
| 64 | +rt = /var/lib/snapd |
| 65 | +``` |
| 66 | + |
| 67 | +--- |
| 68 | + |
| 69 | +### RFID = Remove Files In Directory |
| 70 | + |
| 71 | +Removes all files in a directory but keeps subdirectories. |
| 72 | + |
| 73 | +Example: |
| 74 | + |
| 75 | +```text |
| 76 | +rfid = /var/backups/* |
| 77 | +``` |
| 78 | + |
| 79 | +--- |
| 80 | + |
| 81 | +### RAID = Remove All In Directory |
| 82 | + |
| 83 | +Removes everything inside a directory, but keeps the directory itself. |
| 84 | + |
| 85 | +Example: |
| 86 | + |
| 87 | +```text |
| 88 | +raid = /home/§user/Downloads |
| 89 | +``` |
| 90 | + |
| 91 | +--- |
| 92 | + |
| 93 | +### RAIT = Remove All In Tree |
| 94 | + |
| 95 | +Removes all files and directories inside a directory, including subdirectories, but keeps the top-level directory. |
| 96 | + |
| 97 | +Example: |
| 98 | + |
| 99 | +```text |
| 100 | +rait = /tmp |
| 101 | +``` |
| 102 | + |
| 103 | +--- |
| 104 | + |
| 105 | +## Example Exclude Entries |
| 106 | + |
| 107 | +```text |
| 108 | +# Temporary directories |
| 109 | +rait = /tmp |
| 110 | +rait = /var/tmp |
| 111 | +rait = /var/cache/apt/archives |
| 112 | +
|
| 113 | +# Logs |
| 114 | +rait = /var/log |
| 115 | +
|
| 116 | +# Browser cache |
| 117 | +rait = /home/§user/.cache/mozilla |
| 118 | +rait = /home/§user/.cache/chromium |
| 119 | +
|
| 120 | +# Downloads folder contents |
| 121 | +raid = /home/§user/Downloads |
| 122 | +
|
| 123 | +# Snap |
| 124 | +rt = /var/lib/snapd |
| 125 | +rt = /home/§user/snap |
| 126 | +``` |
| 127 | + |
| 128 | +--- |
| 129 | + |
| 130 | +## Notes |
| 131 | + |
| 132 | +* Commands are case-insensitive. |
| 133 | +* Spaces around `=` are optional. |
| 134 | +* Invalid or missing paths are ignored. |
| 135 | +* Be careful when using `rt`, because it removes complete directory trees. |
| 136 | +* `raid` and `rait` are safer if you want to keep the main directory structure. |
| 137 | +* Comment out optional entries with `#` if you do not want them to be used. |
| 138 | +* The exclude file is processed before shrinking and compression start. |
| 139 | + |
| 140 | +--- |
| 141 | + |
| 142 | +# Compression Guide |
| 143 | + |
| 144 | +pibackup uses Zstandard (zstd) with long mode always enabled. |
| 145 | + |
| 146 | +## Compression Levels |
| 147 | + |
| 148 | +### Level 1–3 |
| 149 | + |
| 150 | +* Very fast |
| 151 | +* Larger backup files |
| 152 | +* Good for frequent backups |
| 153 | + |
| 154 | +### Level 4–6 |
| 155 | + |
| 156 | +* Best balance between speed and compression |
| 157 | +* Recommended for most users |
| 158 | +* Suggested default range |
| 159 | + |
| 160 | +### Level 7–10 |
| 161 | + |
| 162 | +* Better compression ratio |
| 163 | +* Noticeably slower |
| 164 | +* Useful if storage space is important |
| 165 | + |
| 166 | +### Level 11–19 |
| 167 | + |
| 168 | +* Maximum compression ratio |
| 169 | +* Very slow |
| 170 | +* Usually only useful for archive backups |
| 171 | + |
| 172 | +## Long Mode (--long) |
| 173 | + |
| 174 | +Long mode is always enabled. |
| 175 | + |
| 176 | +It improves compression by searching further back in the data stream. |
| 177 | +This is especially useful for Raspberry Pi images because they often contain many repeated patterns. |
| 178 | + |
| 179 | +Important: |
| 180 | + |
| 181 | +* Lower compression levels with long mode can sometimes achieve similar results faster than higher levels without it. |
| 182 | +* Very high compression levels often provide only small additional savings. |
| 183 | +* Level 4–6 is usually the best compromise. |
| 184 | + |
| 185 | +## Recommended Levels by Device |
| 186 | + |
| 187 | +### Raspberry Pi 3 |
| 188 | + |
| 189 | +* Level 3–5 |
| 190 | + |
| 191 | +### Raspberry Pi 4 |
| 192 | + |
| 193 | +* Level 4–7 |
| 194 | + |
| 195 | +### Raspberry Pi 5 |
| 196 | + |
| 197 | +* Level 5–10 |
0 commit comments