Skip to content

Instantly share code, notes, and snippets.

@ohmydevops
Last active November 10, 2019 20:31
Show Gist options
  • Save ohmydevops/909508b77cb015c65be777d3830b7d15 to your computer and use it in GitHub Desktop.
Save ohmydevops/909508b77cb015c65be777d3830b7d15 to your computer and use it in GitHub Desktop.
#! /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