-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
30 lines (21 loc) · 1.05 KB
/
Makefile
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
.PHONY : compress uncompress
.DEFAULT_GOAL := compress
capture:
@mkdir -p output
echo "compressing active apps"
@docker exec -u 0 -it splunk /bin/bash -c 'cd /opt/splunk/etc/apps/ && tar czvf /opt/splunk_httpinput.tgz splunk_httpinput'
@docker exec -u 0 -it splunk /bin/bash -c 'cd /opt/splunk/etc/apps/ && tar czvf /opt/lma.tgz lma'
@echo "copying compressed configs to temp directory"
@docker cp splunk:/opt/splunk_httpinput.tgz output/
@docker cp splunk:/opt/lma.tgz output/
@echo "You must now copy the files in the output directory to the configs directory... "
uncompress:
mkdir -p temp
cd temp && tar zxvf ../configs/lma.tgz
cd temp && tar zxvf ../configs/splunk_httpinput.tgz
@echo "You can now work on the files in the temp directory use command make compress to zip back up"
compress:
mkdir -p output
cd temp && tar --disable-copyfile -czvf ../output/lma.tgz lma
cd temp && tar --disable-copyfile -czvf ../output/splunk_httpinput.tgz splunk_httpinput
@echo "You must now copy the files in the output directory to the configs directory... "