Author Topic: how to create cron job with date parameters  (Read 4017 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
how to create cron job with date parameters
« 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?
« Last Edit: January 14, 2020, 07:44:40 AM by alireza_salehi »

Offline
*****
Re: how to create cron job with date parameters
« Reply #1 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"
You can ask me to solve any problem with your server for some money in pm  ;)
Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor
Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services