AlxVallejo
AlxVallejo

Reputation: 3219

Dynamic filename in mysqldump - date

So far I've tried:

'date +"%Y-%m-%d_%H%M"'_PostsOnly.sql

With output:

date\ +"%Y-%m-%d_%H%M"_PostsOnly.sql

2)

'date +"\%Y-\%m-\%d_\%H\%M"_PostsOnly'.sql

With output:

date\ +"\\%Y-\\%m-\\%d_\\%H\\%M"_PostsOnly.sql

Anyone care to correct me?

Upvotes: 1

Views: 2545

Answers (1)

johnshen64
johnshen64

Reputation: 3884

localhost ~]$ echo $(date +"%Y-%m-%d_%H%M")_PostsOnly.sql
2012-03-23_1507_PostsOnly.sql

Upvotes: 2

Related Questions