{"id":924,"date":"2015-06-04T09:55:39","date_gmt":"2015-06-04T07:55:39","guid":{"rendered":"http:\/\/fougere.myds.me:8080\/info\/?p=924"},"modified":"2015-06-04T09:55:39","modified_gmt":"2015-06-04T07:55:39","slug":"my_exp_database-sh","status":"publish","type":"post","link":"http:\/\/les-fougs.com\/wordpress\/2015\/06\/04\/my_exp_database-sh\/","title":{"rendered":"my_exp_database.sh"},"content":{"rendered":"<pre>#!\/bin\/bash\n# ==================================================\n# Nom : my_exp_database.sh\n# Objet : export database\n# Auteur : N.LAMOTTE\n# Cree le : 08\/02\/2012\n# Syntaxe : my_exp_database.sh user pwd database_name (otheroption1, otheroption2, otheroption1otheroption3 not mandatory)\n# ==================================================<\/pre>\n<pre>user=$1\npwd=$2\ndatabase=$3\notheroption1=$4\notheroption2=$5\notheroption3=$6<\/pre>\n<pre>\nw_date=$(date '+%Y_%m_%d_%H_%M_%S')\nlogpath=\/exploit\/logs\ndumppath=\/exploit\/dumps\nlogfile=my_exp_${database}_${w_date}.log\ndumpfile=my_exp_${database}.sql<\/pre>\n<pre>\n# ----------------------------------\n# Fonction d'affichage de la syntaxe\n# ----------------------------------\nsyntaxe()\n{\n echo \"Usage : $0 $1 user $2 pwd $3 database_name ($4 otheroption1 $5 otheroption2 $6 otheroption3 not mandatory)\"\n}\n# ----------------------------------<\/pre>\n<pre>\n# --------------------------\n# Verification de la syntaxe\n# --------------------------\n#if [ $# -ne 3 -a $# -ne 4 ]\nif [ $# -lt 3 ]\nthen\n echo \"==================================================\"\n echo \"ERREUR : Nombre d'arguments incorrects !\"\n syntaxe\n echo \"==================================================\"\n exit 1\nfi<\/pre>\n<pre>if [ $# -gt 4 ]\nthen\n echo \"mysql with option $otheroption1 $otheroption2 $otheroption3\"\n dumpfile=my_exp_${database}_withoption.sql\n logfile=my_exp_${database}_withoption_${w_date}.log\nfi<\/pre>\n<pre>\n#mysqldump -u $user -p${pwd} $database $otheroption1 $otheroption2 $otheroption3 --log-error=$logpath\/$logfile &gt; $dumppath\/$dumpfile\nmysqldump -u $user -p${pwd} -v $database $otheroption1 $otheroption2 $otheroption3 &gt; $dumppath\/$dumpfile<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#!\/bin\/bash # ================================================== # Nom : my_exp_database.sh # Objet : export database # Auteur : N.LAMOTTE # Cree le : 08\/02\/2012 # Syntaxe : my_exp_database.sh user pwd database_name (otheroption1, otheroption2, otheroption1otheroption3 not mandatory) # ================================================== user=$1 pwd=$2 database=$3 otheroption1=$4 otheroption2=$5 otheroption3=$6 w_date=$(date &lsquo;+%Y_%m_%d_%H_%M_%S&rsquo;) logpath=\/exploit\/logs dumppath=\/exploit\/dumps logfile=my_exp_${database}_${w_date}.log dumpfile=my_exp_${database}.sql # &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- # Fonction d&rsquo;affichage de la syntaxe &hellip; <a href=\"http:\/\/les-fougs.com\/wordpress\/2015\/06\/04\/my_exp_database-sh\/\" class=\"more-link\">Continuer la lecture<span class=\"screen-reader-text\"> de &laquo;&nbsp;my_exp_database.sh&nbsp;&raquo;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[53,35],"tags":[],"_links":{"self":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts\/924"}],"collection":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/comments?post=924"}],"version-history":[{"count":0,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts\/924\/revisions"}],"wp:attachment":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/media?parent=924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/categories?post=924"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/tags?post=924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}