how to get timestamp in shell script code example
Example 1: shell script current time
#!/bin/bash
now="$(date)"
printf "Current date and time %s\n" "$now"
now="$(date +'%d/%m/%Y')"
printf "Current date in dd/mm/yyyy format %s\n" "$now"
echo "Starting backup at $now, please wait..."
# command to backup scripts goes here
# ...
Example 2: unix timestamp bash
date +%s
# Give the number of seconds since epoch