Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#! /bin/bash
# clear screen!
clear
# change Time zone to tehran in current process
TZ=Asia/Tehran
# ask for gitea backup directory on your machine
echo -n "Enter gitea backup full path (example: /var/log/gitea/): "
read GITEA_BACKUP_PATH
# iterate on all files with "gitea*.zip" pattern and convert unixtime to human readable format
for file in $(find $GITEA_BACKUP_PATH -name "gitea*.zip" -type f); do
echo -n $file " => "
echo $file | grep -o -E '[0-9]+' | sed 's/^/@/' | date -f - +'%Y-%m-%d %H:%M:%S'
echo "-------------------"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.