mirror of
https://github.com/YunoHost-Apps/zabbix_ynh.git
synced 2024-09-03 20:36:14 +02:00
simplify timestamp formatting
This commit is contained in:
parent
1d4b6ba4ad
commit
b9264cb0e1
1 changed files with 1 additions and 1 deletions
|
@ -36,7 +36,7 @@ fi
|
|||
|
||||
if [ "$1" == "yunohost.backups.ageoflastbackup" ] ;then
|
||||
if [ $($yunobin backup list --output-as plain | wc -l) -ne 0 ] ;then
|
||||
timestamp=$(date +"%d/%m/%Y %H:%M" -d"$($yunobin backup list -i | tail -n 4 | head -n 1 | grep -Po 'created_at: \K(.*)')")
|
||||
timestamp=$(date +"%F %R" -d"$($yunobin backup list -i | tail -n 4 | head -n 1 | grep -Po 'created_at: \K(.*)')")
|
||||
echo $(( ($(date +%s) - $(date -d"$timestamp" +%s))/(60*60*24) ))
|
||||
else
|
||||
echo "No backup detected"
|
||||
|
|
Loading…
Add table
Reference in a new issue