This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tar-redos.sh
61 lines (53 loc) · 1.57 KB
/
tar-redos.sh
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
set -e
#
# change dir to common folder for this VM
#
cd /common
#
# find all pipes and char files to exclude from image
# cuz some rootless docker versions can crash on loading because of them
#
# also remove python caches
#
find / -type p -o -type c -o -type b -o -type s -o -name __pycache__ > exclude_types.txt
find /usr/share/locale \
-not -name "ru" -not -name "ru_*" \
-not -name "en" -not -name "en_*" -not -name "en@*" > exclude_locales.txt
#
# tar whole system with some exclusions:
# * dynamic data
# * my common folder for this virtual machine (/common)
# * files with bad types
# * VBox Guest Additions
# * bash/python history
# * this repo git info and user git info
# * /tmp
# * /boot
# * kernels
# * logs
#
tar --numeric-owner \
--exclude=/proc --exclude=/sys \
--exclude=/common \
--exclude-from="./exclude_types.txt" \
--exclude-from="./exclude_locales.txt" \
--exclude='/opt/VBoxGuestAdditions*' \
--exclude='~/*_history' \
--exclude='~/.git*' \
--exclude='/RedOS-image/.git' \
--exclude='/tmp/*' \
--exclude='/boot/*' \
--exclude='/usr/lib/modules/*' \
--exclude='/lib/modules/*' \
--exclude='~/.cache' \
--exclude='/var/cache/*' \
--exclude='/var/tmp/*' \
--exclude='~/.*_history' \
--exclude='/var/log/*' \
--exclude='/dev/*' \
--exclude='/run/udev/links/*' \
--exclude='/run/systemd/journal/streams/*' \
--exclude='/usr/src/kernels/*' \
--exclude='/usr/share/icons/*' \
--exclude='/usr/lib/firmware' \
-cvf redos73-base.tar / | tee /common/in_image.txt