File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -61,10 +61,9 @@ createZlog () {
61
61
journalctl --flush >> ${ZLOG} 2>&1 || return 1
62
62
if [ ! -z " $OLDLOG_DIR " ]
63
63
then
64
- cp -arvf /etc/logrotate.conf ${ZSHARE} /logrotate.conf.bak >> ${ZLOG} 2>&1 || return 1
65
- sed -i " /^weekly.*/i olddir ${ZDIR}${OLDLOG_DIR} " /etc/logrotate.conf >> ${ZLOG} 2>&1 || return 1
66
- sed -i " /^weekly.*/i createolddir 755 root root" /etc/logrotate.conf >> ${ZLOG} 2>&1 || return 1
67
- sed -i " /^weekly.*/i renamecopy" /etc/logrotate.conf >> ${ZLOG} 2>&1 || return 1
64
+ echo " olddir " ${ZDIR}${OLDLOG_DIR} > /etc/logrotate.d/00_oldlog
65
+ echo " createolddir 755 root root" >> /etc/logrotate.d/00_oldlog
66
+ echo " renamecopy" >> /etc/logrotate.d/00_oldlog
68
67
else
69
68
echo " createZlog no oldlog dir in ztab" >> ${ZLOG}
70
69
fi
@@ -112,7 +111,7 @@ mergeOverlay () {
112
111
removeZlog () {
113
112
if [ ! -z " $OLDLOG_DIR " ]
114
113
then
115
- cp -arvf ${ZSHARE} /logrotate.conf.bak / etc/logrotate.conf >> ${ZLOG} 2>&1 || return 1
114
+ rm / etc/logrotate.d/00_oldlog
116
115
fi
117
116
echo " $ZRAM_DEV " >> ${ZLOG}
118
117
# syncToDisk
You can’t perform that action at this time.
0 commit comments