forked from Squidly271/ca.backup2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ca.backup2.plg
195 lines (152 loc) · 5.05 KB
/
ca.backup2.plg
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
<?xml version='1.0' standalone='yes'?>
<!DOCTYPE PLUGIN [
<!ENTITY name "ca.backup2">
<!ENTITY author "Robin Kluth">
<!ENTITY version "2023.03.28c">
<!ENTITY md5 "ebb52b856918c7d6e090063a2551711f">
<!ENTITY launch "Settings/BackupMainV2">
<!ENTITY plugdir "/usr/local/emhttp/plugins/&name;">
<!ENTITY github "Commifreak/ca.backup2">
<!ENTITY pluginURL "https://raw.githubusercontent.com/&github;/master/&name;.plg">
]>
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;" pluginURL="&pluginURL;" icon="shield">
<CHANGES>
<![CDATA[
###2023.03.28
- Show deprecation banner, if installed on Unraid 6.12
###2023.01.28
- Fixed Array state detection - now works the Unraid way
###2023.01.11
- 🚀 Happy new year!
- Added an option, to disable backup error detection.
###2022.12.27
- Fixed restore
###2022.12.22
- Added some debug infos for the "Already started" docker issue
- Fixes "Abort" function
###2022.12.08
- Fix scanned source files with spaces in it
- Output a bit more debug info for not stopped containers.
###2022.12.05
- Fix `Allowed memory size of xxx exhausted` error, which was caused by a too big logfile from previous plugin
version.
- Also copy the log in case of an error
- Fixed the exclusion of subfolders
###2022.12.04
- Fixed a permission issue, which prevented the backup to run
###2022.12.02
- Fixed tar verification check
- Changed schedule hour format in settings page
- Added option to disable the warning message when accessing the settings page
- Added option to create multiple archives - one for each appdata folder
- Fixed some styling inside settings page
- The logging tab now shows the whole log as well as date/time
- Fixed an error, which caused a reset of the log while backing up
- Made docker container stops/starts more robust: the plugin now tries 3 times to start a container
- The backup log is now copied to the destination to keep it with its run
###2022.07.23
- Set permissions on backups to be 0777
###2021.12.05
- Don't exclude the docker image file since it's now extremely rare for it to be placed within appdata
###2021.11.03
- Fixed: File picker for start / stop scripts wasn't working
###2021.03.13
- Deprecate usb backup (still works though) when running Unraid 6.9
###2021.03.10
- Permission Fix
###2020.12.27
- Fix some permission issues
###2020.10.21
- Compatibility Fixes
###2020.09.27
- When running 6.9-beta 27+, clicking on the notification will take you to the plugin's settings
###2020.07.09
- Execute all custom scripts from RAM
###2020.05.31
- Add pre-start script (Thanks jburnham)
###2019.10.27
- Adjust permissions on backup version of flash drive
###2019.09.25
- Remove purple text
###2019.03.23
- Utilize CA API for update checks
###2019.03.09
- Only rewrite the disk assignments file if it's changed
###2019.01.13
- update Icon
###2018.11.17
- unRaid 6.6+: Honor autostart rules when restarting containers
###2018.11.11
- Add in autov routines
###2018.11.01
- Fix dropdown color for 6.6
###2018.10.19
- Fix Broken Pipe
###2018.07.15
- Fixed: Don't run a scheduled backup if array isn't started
###2018.03.15
- Fixed: Don't delete old backup sets if the source doesn't exist
###2018.03.02
- Fixed: PHP Warnings (hidden) in 6.5.0+
###2017.12.22
- Fixed: Apply not being activated when using customized excluded folder
###2017.11.26
- Fixed: Backup schedule wouldn't run following a reboot of server
###2017.11.23
- Reorganization as part of updates to CA proper
###2017.11.05
- Initial Release
]]>
</CHANGES>
<!-- The 'pre-install' script. -->
<FILE Run="/bin/bash">
<INLINE>
# Remove old 'source' files
rm -f $(ls /boot/config/plugins/&name;/&name;*.txz 2>/dev/null | grep -v '&version;')
</INLINE>
</FILE>
<!--
The 'source' file.
-->
<FILE Name="/boot/config/plugins/&name;/&name;-&version;-x86_64-1.txz" Run="upgradepkg --install-new">
<URL>https://github.com/&github;/releases/download/v&version;/&name;-&version;-x86_64-1.txz</URL>
<MD5>&md5;</MD5>
</FILE>
<!--
The 'post-install' script
-->
<FILE Run="/bin/bash">
<INLINE>
mkdir -p /tmp/ca.backup2/tempFiles
mkdir -p /var/lib/docker/unraid/ca.backup2.datastore
mkdir -p /boot/config/plugins/ca.backup2/
rm -rf /usr/local/emhttp/plugins/ca.backup2/CA.page
rm -rf /usr/local/emhttp/plugins/ca.backup2/caHelp.page
echo ""
echo "----------------------------------------------------"
echo " &name; has been installed."
echo " 2022-2023, Robin Kluth"
echo " 2015-2022, Andrew Zawadzki"
echo " Version: &version;"
echo "----------------------------------------------------"
echo ""
</INLINE>
</FILE>
<FILE Run="/bin/bash" Max="6.11.5">
<INLINE>
/usr/local/emhttp/plugins/ca.backup2/scripts/removeCron.php
/usr/local/emhttp/plugins/ca.backup2/scripts/addCron.php
</INLINE>
</FILE>
<!--
The 'remove' script.
-->
<FILE Run="/bin/bash" Method="remove">
<INLINE>
/usr/local/emhttp/plugins/ca.backup2/scripts/removeCron.php
removepkg &name;-&version;-x86_64-1
rm -rf &plugdir;
rm -rf /boot/config/plugins/&name;
</INLINE>
</FILE>
</PLUGIN>