ubuntu - how to zip the output of the mysqldump command? -
i have cron with
#!/bin/sh #string representation current day day=$(date +%y%m%d) #archive db content /usr/bin/mysqldump --opt --host=db_host --user=db_user --password=db_pass db_name | /bin/gzip -c -9 > ${day}_db_name.gz
which runs fine. however, create zip file instead using zip compression.
i tried with
/usr/bin/mysqldump --opt --host=db_host --user=db_user --password=db_pass db_name | zip -q -9 > ${day}_db_name.zip
and result archive file named "-" inside. question how can change name previous command generated, 20130725_db_name?
it says here zip , input , pipeing , "streaming input , output" but, unfortunately, that's me understand
Comments
Post a Comment