<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Roberto Ferro</title>
    <description>The latest articles on DEV Community by Roberto Ferro (@robyferro).</description>
    <link>https://dev.to/robyferro</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F119919%2Fa4dd8062-5dc1-4b71-bae8-2872c53676f4.png</url>
      <title>DEV Community: Roberto Ferro</title>
      <link>https://dev.to/robyferro</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/robyferro"/>
    <language>en</language>
    <item>
      <title>PyKup - Web App backup manager</title>
      <dc:creator>Roberto Ferro</dc:creator>
      <pubDate>Wed, 05 Dec 2018 18:07:42 +0000</pubDate>
      <link>https://dev.to/robyferro/pykup---web-app-backup-manager-5ggl</link>
      <guid>https://dev.to/robyferro/pykup---web-app-backup-manager-5ggl</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flg2k2gg0gt20ng4ylgrv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flg2k2gg0gt20ng4ylgrv.jpg" alt="Pykup" width="366" height="108"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h1&gt;
  
  
  PyKup - WebApp backup manager
&lt;/h1&gt;

&lt;p&gt;A simple tool to easily manage and schedule backup for any web app!&lt;br&gt;
With PyKup you can backup your web applications in just one command.&lt;br&gt;
Everything will be compressed and stored in your favorite storage location.&lt;/p&gt;
&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python pykup.py -d &amp;lt;APP_FOLDER&amp;gt; -cF &amp;lt;PATH_CONFIG_FILE&amp;gt; -uD &amp;lt;UPLOAD_DRIVER dropbox|scp&amp;gt; --cron 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Multiple application backup
&lt;/h2&gt;

&lt;p&gt;With crontab integration you can schedule multiple application backup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python pykup.py -d &amp;lt;APP_FOLDER_1&amp;gt; -cF &amp;lt;PATH_CONFIG_FILE_1&amp;gt; -uD &amp;lt;UPLOAD_DRIVER dropbox|scp&amp;gt; --cron 
python pykup.py -d &amp;lt;APP_FOLDER_2&amp;gt; -cF &amp;lt;PATH_CONFIG_FILE_2&amp;gt; -uD &amp;lt;UPLOAD_DRIVER dropbox|scp&amp;gt; --cron 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;First of all ensure that Python 3 is installed on your machine, then you can get all file with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/RobyFerro/PyKup.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install all requirements with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install -r requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that you can get all information by typing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;usage: pykup.py [-h] -d DIRECTORY [-n APP_NAME] -cF CONFIG_FILE
                [-uD UPLOAD_DRIVER] [-rF REMOTE_FOLDER] [--cron]

PyBack WebApp backup utils

optional arguments:
  -h, --help         show this help message and exit
  -d DIRECTORY       Set a backup directory
  -n APP_NAME        Define application name
  -cF CONFIG_FILE    Define configuration file
  -uD UPLOAD_DRIVER  Define upload driver dropbox|scp
  -rF REMOTE_FOLDER  Define scp remote folder
  --cron             Set command in crontab
  --telegram         Send telegram notification after backup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Config
&lt;/h2&gt;

&lt;p&gt;To config your web app you should rename config.ini.example in config directory&lt;br&gt;
and replace all values with your parameters.&lt;/p&gt;

&lt;p&gt;You can set multiple .ini file to schedule multiple backup&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;first-app.ini
second-app.ini
third-app.ini
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;This trick it will be useful combinated with --cron option.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Crontab events
&lt;/h2&gt;

&lt;p&gt;To set the current command inside linux crontab job you've just to specify --cron option.&lt;br&gt;
Use the following command to show all existing crontab job:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;crontab -l
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Dropbox integration
&lt;/h2&gt;

&lt;p&gt;To upload your backups on dropbox you've to create a new application inside your &lt;a href="https://www.dropbox.com/developers/apps/create" rel="noopener noreferrer"&gt;Dropbox account&lt;/a&gt; &lt;br&gt;
and follow this steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select Dropbox API&lt;/li&gt;
&lt;li&gt;Select "App folder"&lt;/li&gt;
&lt;li&gt;Select your app name&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once created you've to generate a new access token and put it on config/integrations/dropbox.json&lt;/p&gt;

&lt;h2&gt;
  
  
  Telegram confirm notification
&lt;/h2&gt;

&lt;p&gt;To send a notification to your own telegram channel you've to create a &lt;a href="https://core.telegram.org/bots#6-botfather" rel="noopener noreferrer"&gt;Telegram bot&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Insert your TOKEN and Telegram user ID in config.ini file&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Todo list:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[x] File backup and compression&lt;/li&gt;
&lt;li&gt;[x] Log activity&lt;/li&gt;
&lt;li&gt;[x] PostgreSQL dump&lt;/li&gt;
&lt;li&gt;[x] MySQL dump&lt;/li&gt;
&lt;li&gt;[x] Dropbox integration&lt;/li&gt;
&lt;li&gt;[x] SCP Sync&lt;/li&gt;
&lt;li&gt;[x] Rsync integration&lt;/li&gt;
&lt;li&gt;[x] Crontab integration&lt;/li&gt;
&lt;li&gt;[x] Telegram confirm notification&lt;/li&gt;
&lt;li&gt;[ ] Telegram bot remote control&lt;/li&gt;
&lt;li&gt;[ ] Google Drive Integration&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Need help?
&lt;/h2&gt;

&lt;p&gt;Join in our &lt;a href="https://t.me/ikdev" rel="noopener noreferrer"&gt;Telegram community&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>python</category>
      <category>devops</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
