Hello,
In my deployments, I tend to do db backups and dump them into filenames
containing a timestamp like so:
mysqldump dbname | gzip -9c > ~/dbname.`date +%Y-%m-%d.%H%M`.sql.gz ; ls
-la ~/ | grep `date +%Y-%m-%d`
As you can see, when the dump is done, I want to see the resulting file
just to eyeball it and make everything looks right.
(To answer future questions: we date time stamp our backup files so that we
can keep them for an extended period of time.)
I would like to write something like this:
- hosts: dbserver
remote_user: jlouthan
tasks:
- name: Backup Prod Database
shell: mysqldump dbdump | gzip -9c > ~jlouthan/dbdump.`date
+%Y-%m-%d`.sql.gz
become: yes
become_method: sudo
- name: Check to see if the dbdump has been successfully created
wait_for: path=~jlouthan/dbdump.`date +%Y-%m-%d`.sql.gz
Is there any chance that Ansible would be able to pick up on backticks or
is there a better way?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/d0ea5d1c-71b5-4bef-aeaf-1174cd37937d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.