当前位置 : 李杰的流水账 > 技术 > linux

mysql按天备份常用ssh命令

#!/bin/bash mysqldump cms > /service/backup/mysql/cms/$(date +%Y%m%d_%H%M%S).sql mysqldump mall > /service/backup/mysql/mall/$(date +%Y%m%d_%H%M%S).sql #!/bin/bash cd /service/backup/mysql/cms/; ls -al; cd /service/backup/mysql/mall/; ls -al; 某天之前一天 [www@centos_solr ~]$ date -d"20140101 -1 days" +"%Y%m%d" 20131231 [www@centos_solr ~]$ echo date -d"20140101 -1 days" +"%Y%m%d" date -d20140101 -1 days +%Y%m%d [www@centos_solr ~]$ echo $(date -d"20140101 -1 days" +"%Y%m%d") 20131231 [www@centos_solr ~]$ echo $(date -d" -1 days" +"%Y%m%d") 20180221 [www@centos_solr ~]$ echo $(date -d"-1 days" +"%Y%m%d") 20180221 [www@centos_solr ~]$ echo $(date -d"-1 month" +"%Y%m%d") 20180122 [www@centos_solr ~]$ echo $(date -d"-1 months" +"%Y%m%d") 20180122

内容列表