forked from evolix/evobackup
Remove get_inc function
This commit is contained in:
parent
a028d3abee
commit
41b3536bcf
|
@ -22,6 +22,12 @@ trap "rm ${duc_output} ${incs_output} ${stat_output}" 0
|
||||||
"${DUC}" ls -d "${IDX_FILE}" "${JAILDIR}" > "${duc_output}"
|
"${DUC}" ls -d "${IDX_FILE}" "${JAILDIR}" > "${duc_output}"
|
||||||
awk '{ print $2 }' "${duc_output}" | while read jail; do
|
awk '{ print $2 }' "${duc_output}" | while read jail; do
|
||||||
stat --format=%Y "/backup/jails/${jail}/var/log/lastlog" | xargs -i -n1 date -d "@{}" "+%d-%m-%Y" >> "${stat_output}"
|
stat --format=%Y "/backup/jails/${jail}/var/log/lastlog" | xargs -i -n1 date -d "@{}" "+%d-%m-%Y" >> "${stat_output}"
|
||||||
get_inc "${jail}" >> "${incs_output}"
|
inc=0
|
||||||
|
if [ -f "${CONFDIR}/${jail}" ]; then
|
||||||
|
day=$(grep -c "day" "${CONFDIR}/${jail}")
|
||||||
|
month=$(grep -c "month" "${CONFDIR}/${jail}")
|
||||||
|
inc="${day}/${month}"
|
||||||
|
fi
|
||||||
|
echo "${inc}" >> "${incs_output}"
|
||||||
done
|
done
|
||||||
paste "${duc_output}" "${incs_output}" "${stat_output}" | awk '{ printf("%- 30s %- 10s %- 10s %- 15s\n", $2, $1, $3, $4); }'
|
paste "${duc_output}" "${incs_output}" "${stat_output}" | awk '{ printf("%- 30s %- 10s %- 10s %- 15s\n", $2, $1, $3, $4); }'
|
||||||
|
|
|
@ -12,7 +12,12 @@ if [ ! -n "${jail}" ]; then
|
||||||
fi
|
fi
|
||||||
check_jail "${jail}" || error "${jail} : inexistant jail ! Use '$0 status' for list all"
|
check_jail "${jail}" || error "${jail} : inexistant jail ! Use '$0 status' for list all"
|
||||||
|
|
||||||
inc=$(get_inc "${jail}")
|
inc="0"
|
||||||
|
if [ -f "${CONFDIR}/${jail}" ]; then
|
||||||
|
day=$(grep -c "day" "${CONFDIR}/${jail}")
|
||||||
|
month=$(grep -c "month" "${CONFDIR}/${jail}")
|
||||||
|
inc="${day}/${month}"
|
||||||
|
fi
|
||||||
if ( check_jail_on "${jail}" ); then
|
if ( check_jail_on "${jail}" ); then
|
||||||
status="ON "
|
status="ON "
|
||||||
else
|
else
|
||||||
|
|
|
@ -20,14 +20,3 @@ check_jail_on() {
|
||||||
fi
|
fi
|
||||||
return "${return}"
|
return "${return}"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_inc() {
|
|
||||||
jail="${1}"
|
|
||||||
inc="0"
|
|
||||||
if [ -f "${CONFDIR}/${jail}" ]; then
|
|
||||||
day=$(grep -c "day" "${CONFDIR}/${jail}")
|
|
||||||
month=$(grep -c "month" "${CONFDIR}/${jail}")
|
|
||||||
inc="${day}/${month}"
|
|
||||||
fi
|
|
||||||
echo "${inc}"
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue