Control Web Panel

WebPanel => CentOS 7 Problems => Topic started by: alireza_salehi on January 14, 2020, 07:29:25 AM

Title: how to create cron job with date parameters
Post by: alireza_salehi on January 14, 2020, 07:29:25 AM
hi
i want to create cron job like this from user panel:

Code: [Select]
mysqldump -u uuuu -pxxx --default-character-set=utf8 myuser_db | gzip > /home/myuser/backups/db-`date +\%Y\%m\%d-\%H\%M`.sql.gz
but date parameters never works and i see db-{Q3}.sql.gz in output folder,
how can i create a cron job inside user panel with date parameters and formatting?
Title: Re: how to create cron job with date parameters
Post by: Igor S. on January 21, 2020, 07:41:47 AM
Try to run the command in the console and check what happened.  I suppose, you have to use double quotes in the path. "/home/myuser/backups/db-`date +\%Y\%m\%d-\%H\%M`.sql.gz"