Last active
November 10, 2019 20:31
-
-
Save ohmydevops/909508b77cb015c65be777d3830b7d15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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