Backup to Google Disk

    This script backup directories /etc/astra and file /usr/bin/astra to Google.Disk service.

    Install Gdrive

    wget -O /usr/bin/gdrive
    chmod +x /usr/bin/gdrive 


    Run the gdrive list command. A link will be generated. Copy link and open it in your browser. This authorizes gdrive on Google services.
    After authorization in the services, copy the authorization code and paste it into the console:

    [root@server ~]# gdrive list
    Go to the following link in your browser:\\
    Enter the code from the page:
    Enter verification code: 4/sgH7WCEJhlGTmWTOQ-Dvc6IbErAh2p0LbruYYFNnWSb2befbtafQltM
    Usage: drive [global options] <verb> [verb options]

    Create a script

    TAR="$(which tar)"
    GZIP="$(which gzip)"
    FTP="$(which ftp)"
    NOW=$(date +%Y%m%d)
    mkdir /tmp/backuptmp
    mkdir /tmp/backuptmp/$NOW
    $TAR -cf /tmp/backuptmp/$NOW/etc_astra.tar /etc/astra
    $TAR -cf /tmp/backuptmp/$NOW/astra_bin.tar /usr/bin/astra
    cd $BACKUP
    /usr/bin/gdrive upload /tmp/backuptmp/$DUMPFILE
    rm -rf /tmp/backuptmp/*

    Save this script as in the directory /opt

    Configure cron (Linux task scheduler)

    Open the editor with the command

    sudo crontab -u root -e

    And in the opened file add a line:

    40 2 * * * sh /opt/ > /dev/null

    Do not forget to put Enter at the end of the line (to line break!)

    Save the file. Now at 2 hours 40 minutes (at night) you will have a backup of Astra in your Google Disk in the backup directory with the current date.