I want to create the backup of the Wordpress website in a directory example.com
. The output file should be in the following format:
YmDHM_example.com.zip
Using the current date and time, it would be: 202003211045_example.com.zip
.
So far I got to this point:
$ zip -r "$(date +"%Y%m%d%H%M")_example.com.zip" example.com
But would like the example.com
part to be also created "dynamically". I saw this answer, but it doesn't mention how to include the date in the output file.
How can I do it?