<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Lenine Djouatsa on Medium]]></title>
        <description><![CDATA[Stories by Lenine Djouatsa on Medium]]></description>
        <link>https://medium.com/@leninedjouatsa?source=rss-3127e135c69d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*4C7GNxgYaaJ5sQXZ</url>
            <title>Stories by Lenine Djouatsa on Medium</title>
            <link>https://medium.com/@leninedjouatsa?source=rss-3127e135c69d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 06:53:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@leninedjouatsa/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Daily backup my DB]]></title>
            <link>https://medium.com/@leninedjouatsa/daily-backup-my-db-19608e1e1244?source=rss-3127e135c69d------2</link>
            <guid isPermaLink="false">https://medium.com/p/19608e1e1244</guid>
            <dc:creator><![CDATA[Lenine Djouatsa]]></dc:creator>
            <pubDate>Thu, 10 Apr 2025 12:40:03 GMT</pubDate>
            <atom:updated>2025-04-10T12:45:34.432Z</atom:updated>
            <content:encoded><![CDATA[<p>I want to daily save export my DB in order to have a backup in case of disaster.<br>My DB contains Jenkins builds (representation of a QA activities).<br>I need to save the DB to have a history of all builds played by QA.</p><p>Pre-requisites</p><ul><li>Make sure you have AWS CLI install in your VM. You can follow this link for linux (<a href="https://docs.aws.amazon.com/cli/v1/userguide/install-linux.html">https://docs.aws.amazon.com/cli/v1/userguide/install-linux.html</a> )</li><li>Make sure you have MYSQL and that you can connect (mysql -uroot -p)</li></ul><p><strong>Step 1 : Dump the DB</strong></p><p>Use the command below to save the DB in tmp folder</p><p><em>mysqldump -u &lt;username&gt; -p&lt;password&gt; &lt;database_name&gt; &gt; /tmp/db_backup.sql</em></p><p><strong>Step2 : Compress the DB</strong></p><p>Use the command below to compress the dump</p><p><em>tar -czf /tmp/stats_db_backup_$(date +%F).tar.gz /tmp/stats_db_backup.sql</em></p><p><strong>Step 3 : Send backup to AWS S3</strong></p><p>If you have AWS S3 access , you can plan to send backup to S3.</p><p>This will be more secure and interesting for backup<br>Run this command</p><p><em>aws s3 cp — profile your_aws_profile stats_db_backup_$(date +%F).tar.gz s3://your_s3_bucket_name/tools/qa_stats_db_dumps/</em></p><p><strong>Step 4 : Use cron job to daily save the DB</strong></p><ul><li>Create a .sh (backup_qa_stats_db.sh) file and put this final content :</li></ul><p><em>#!/bin/bash</em></p><p><em>exec &gt;&gt; /home/your_user/dev/backup_qa_stats_db.log 2&gt;&amp;1<br>mysqldump -u root -pPWD qa_stats &gt; /tmp/stats_db_backup.sql<br>cd /tmp<br>tar -czf stats_db_backup_$(date +%F).tar.gz stats_db_backup.sql<br>aws s3 cp — profile your_aws_profile stats_db_backup_$(date +%F).tar.gz s3://your_s3_bucket_name/tools/qa_stats_db_dumps/</em></p><ul><li>crontab -e and add the line below (to run the script every day at 02h00)</li></ul><p><em>0 2 * * * /home/your_user/dev/backup_qa_stats_db.sh</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19608e1e1244" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>