{
    "version": "https:\/\/jsonfeed.org\/version\/1",
    "title": "Блог: заметки с тегом backup",
    "_rss_description": "konditerov.ru",
    "_rss_language": "ru",
    "_itunes_email": "",
    "_itunes_categories_xml": "",
    "_itunes_image": "",
    "_itunes_explicit": "",
    "home_page_url": "https:\/\/utata.ru\/tags\/backup\/",
    "feed_url": "https:\/\/utata.ru\/tags\/backup\/json\/",
    "icon": "https:\/\/utata.ru\/user\/userpic@2x.jpg?1641662784",
    "author": {
        "name": "Илья Кондитеров",
        "url": "https:\/\/utata.ru\/",
        "avatar": "https:\/\/utata.ru\/user\/userpic@2x.jpg?1641662784"
    },
    "items": [
        {
            "id": "87",
            "url": "https:\/\/utata.ru\/all\/bekap-vestacp-na-google-drive-ubuntu-16-04\/",
            "title": "Бекап VestaCP в облако на примере Google Drive (Ubuntu 16.04)",
            "content_html": "<p>Эта инструкция написана для меня, но воспользоваться ей может любой, нужны базовые знания консоли linux, минут 30 на настройку.<\/p>\n<p>Для начала нам необходимо установить Rclone:<br \/>\nЗаходим под рутом<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">sudo su<\/code><\/pre><p>Скачиваем и устанавливаем Rclone<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">curl https:\/\/rclone.org\/install.sh | sudo bash<\/code><\/pre><p>Запускаем настройку Rclone<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">rclone config<\/code><\/pre><p>Создаем новый профиль Rclone<\/p>\n<blockquote>\n<p><i>No remotes found — make a new one<\/i><br \/>\n<i>n) New remote<\/i><br \/>\n<i>s) Set configuration password<\/i><br \/>\n<i>q) Quit config<\/i><\/p>\n<\/blockquote>\n<pre class=\"e2-text-code\"><code class=\"\">n\/s\/q&gt; n<\/code><\/pre><p>Задаем имя (тут вы можете назвать как угодно)<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">name&gt; gdrive<\/code><\/pre><p>Выбираем сервис.<br \/>\nУ меня гуглдиск оказался под номером 13, возможно в дальнейшем номер изменится.<\/p>\n<blockquote>\n<p><i>13 \/ Google Drive<\/i><br \/>\n<i>   \\ «drive»<\/i><\/p>\n<\/blockquote>\n<pre class=\"e2-text-code\"><code class=\"\">Storage&gt; 13<\/code><\/pre><p>Тут нам необходимо получить авторизацию у google.<br \/>\nПереходим по ссылке и авторизуемся под своим аккаунтом: <a href=\"https:\/\/code.google.com\/apis\/console\/\">https:\/\/code.google.com\/apis\/console\/<\/a><\/p>\n<p>Создаем проект и даем ему имя → Заходим в проект → Заходим в библиотеки → Ищем <b>Google Drive API<\/b> → Включаем → Переходим в <b>Учетные данные<\/b> → Настроить окно запроса доступа → Заходим в <b>Учетные данные<\/b> → Создаем <b>Идентификатор клиента OAuth<\/b> → <b>Другие типы<\/b> → Получаем ключи:<br \/>\n<b>Идентификатор клиента<\/b> и <b>Секретный код клиента<\/b>, они нам и нужны.<\/p>\n<p>Скринкаст:<\/p>\n<div class=\"e2-text-picture\">\n<div class=\"fotorama\" data-width=\"1423\" data-ratio=\"1.6060948081264\">\n<img src=\"https:\/\/utata.ru\/pictures\/1.png\" width=\"1423\" height=\"886\" alt=\"\" \/>\n<img src=\"https:\/\/utata.ru\/pictures\/2.png\" width=\"1423\" height=\"886\" alt=\"\" \/>\n<img src=\"https:\/\/utata.ru\/pictures\/3.png\" width=\"1423\" height=\"886\" alt=\"\" \/>\n<img src=\"https:\/\/utata.ru\/pictures\/4.png\" width=\"1423\" height=\"886\" alt=\"\" \/>\n<img src=\"https:\/\/utata.ru\/pictures\/5.png\" width=\"1423\" height=\"886\" alt=\"\" \/>\n<img src=\"https:\/\/utata.ru\/pictures\/6.png\" width=\"1423\" height=\"886\" alt=\"\" \/>\n<img src=\"https:\/\/utata.ru\/pictures\/7.png\" width=\"1423\" height=\"886\" alt=\"\" \/>\n<img src=\"https:\/\/utata.ru\/pictures\/8.png\" width=\"1423\" height=\"886\" alt=\"\" \/>\n<img src=\"https:\/\/utata.ru\/pictures\/9.png\" width=\"1423\" height=\"886\" alt=\"\" \/>\n<img src=\"https:\/\/utata.ru\/pictures\/10.png\" width=\"1423\" height=\"886\" alt=\"\" \/>\n<img src=\"https:\/\/utata.ru\/pictures\/11.png\" width=\"1423\" height=\"886\" alt=\"\" \/>\n<img src=\"https:\/\/utata.ru\/pictures\/12.png\" width=\"1423\" height=\"886\" alt=\"\" \/>\n<img src=\"https:\/\/utata.ru\/pictures\/13.png\" width=\"1423\" height=\"886\" alt=\"\" \/>\n<img src=\"https:\/\/utata.ru\/pictures\/14.png\" width=\"1423\" height=\"886\" alt=\"\" \/>\n<img src=\"https:\/\/utata.ru\/pictures\/15.png\" width=\"1423\" height=\"886\" alt=\"\" \/>\n<\/div>\n<\/div>\n<p>Продолжаем настройку Rclone<br \/>\nВводим <b>Идентификатор клиента<\/b><\/p>\n<pre class=\"e2-text-code\"><code class=\"\">client_id&gt; Ваш идентификатор клиента (Client ID)<\/code><\/pre><p>Вводим <b>Секретный код клиента<\/b><\/p>\n<pre class=\"e2-text-code\"><code class=\"\">client_secret&gt; Ваш код клиента (Secret code)<\/code><\/pre><p>далее выбираем<\/p>\n<blockquote>\n<p><i>Scope that rclone should use when requesting access from drive.<\/i><br \/>\n<i>Enter a string value. Press Enter for the default («„).<\/i><br \/>\n<i>Choose a number from below, or type in your own value<\/i><br \/>\n<i> 1 \/ Full access all files, excluding Application Data Folder.<\/i><br \/>\n<i>   \\ „drive“<\/i><br \/>\n<i> 2 \/ Read-only access to file metadata and file contents.<\/i><br \/>\n<i>   \\ „drive.readonly“<\/i><br \/>\n<i>   \/ Access to files created by rclone only.<\/i><br \/>\n<i> 3 | These are visible in the drive website.<\/i><br \/>\n<i>   | File authorization is revoked when the user deauthorizes the app.<\/i><br \/>\n<i>   \\ „drive.file“<\/i><br \/>\n<i>   \/ Allows read and write access to the Application Data folder.<\/i><br \/>\n<i> 4 | This is not visible in the drive website.<\/i><br \/>\n<i>   \\ „drive.appfolder“<\/i><br \/>\n<i>   \/ Allows read-only access to file metadata but<\/i><br \/>\n<i> 5 | does not allow any access to read or download file content.<\/i><br \/>\n<i>   \\ „drive.metadata.readonly“<\/i><\/p>\n<\/blockquote>\n<pre class=\"e2-text-code\"><code class=\"\">scope&gt; 1<\/code><\/pre><p>Далее настройка упрощается, нажимаем <i><b>Enter<\/b><\/i><\/p>\n<blockquote>\n<p><i>ID of the root folder<\/i><br \/>\n<i>Leave blank normally.<\/i><\/p>\n<p><i>Fill in to access «Computers» folders (see docs), or for rclone to use<\/i><br \/>\n<i>a non root folder as its starting point.<\/i><\/p>\n<p><i>Note that if this is blank, the first time rclone runs it will fill it<\/i><br \/>\n<i>in with the ID of the root folder.<\/i><\/p>\n<p><i>Enter a string value. Press Enter for the default («„).<\/i><\/p>\n<\/blockquote>\n<pre class=\"e2-text-code\"><code class=\"\">root_folder_id&gt;<\/code><\/pre><p>Еще раз нажимаем <i><b>Enter<\/b><\/i><\/p>\n<blockquote>\n<p><i>Service Account Credentials JSON file path <\/i><br \/>\n<i>Leave blank normally.<\/i><br \/>\n<i>Needed only if you want use SA instead of interactive login.<\/i><br \/>\n<i>Enter a string value. Press Enter for the default («„).<\/i><\/p>\n<\/blockquote>\n<pre class=\"e2-text-code\"><code class=\"\">service_account_file&gt;<\/code><\/pre><p>Далее<\/p>\n<blockquote>\n<p><i>Edit advanced config? (y\/n)<\/i><br \/>\n<i>y) Yes<\/i><br \/>\n<i>n) No (default)<\/i><\/p>\n<\/blockquote>\n<pre class=\"e2-text-code\"><code class=\"\">y\/n&gt; n<\/code><\/pre><p>Далее<\/p>\n<blockquote>\n<p><i>Remote config<\/i><br \/>\n<i>Use auto config?<\/i><br \/>\n<i> * Say Y if not sure<\/i><br \/>\n<i> * Say N if you are working on a remote or headless machine<\/i><br \/>\n<i>y) Yes (default)<\/i><br \/>\n<i>n) No<\/i><\/p>\n<\/blockquote>\n<pre class=\"e2-text-code\"><code class=\"\">y\/n&gt; n<\/code><\/pre><p>Переходим по этой ссылке в браузере и копируем <b>ваш верификационный код<\/b><\/p>\n<blockquote>\n<p><i>Please go to the following link: <a href=\"https:\/\/accounts.google.com\/o\/oauth2\/auth?.....\">https:\/\/accounts.google.com\/o\/oauth2\/auth?.....<\/a> <\/i><br \/>\n<i>Log in and authorize rclone for access<\/i><\/p>\n<\/blockquote>\n<pre class=\"e2-text-code\"><code class=\"\">Enter verification code&gt; Ваш код<\/code><\/pre><p>Далее<br \/>\n<i>Configure this as a team drive?<\/i><br \/>\n<i>y) Yes<\/i><br \/>\n<i>n) No (default)<\/i><\/p>\n<pre class=\"e2-text-code\"><code class=\"\">y\/n&gt; n<\/code><\/pre><p>И в завершении настройки получаете такое сообщение:<\/p>\n<blockquote>\n<p><i>——————————<\/i><br \/>\n<i>[gdrive]<\/i><br \/>\n<i>type = drive<\/i><br \/>\n<i>client_id = Ваш идентификатор клиента (Client ID)<\/i><br \/>\n<i>client_secret = Ваш код клиента (Secret code)<\/i><br \/>\n<i>scope = drive<\/i><br \/>\n<i>token = {«access_token»:» ¯\\_(ツ)_\/¯ «,«expiry»:«2020-05-07T20:49:03.221799741+03:00»}<\/i><br \/>\n<i>——————————<\/i><br \/>\n<i>y) Yes this is OK (default)<\/i><br \/>\n<i>e) Edit this remote<\/i><br \/>\n<i>d) Delete this remote<\/i><\/p>\n<\/blockquote>\n<p>Проверяем настройки и вводим <b>y<\/b><\/p>\n<pre class=\"e2-text-code\"><code class=\"\">y\/e\/d&gt; y<\/code><\/pre><p>Дальше программа показывает нам созданный профиль и спрашивает что делать дальше<\/p>\n<blockquote>\n<p><i>Current remotes:<\/i><\/p>\n<p><i>Name                 Type<\/i><br \/>\n<i>====                 ====<\/i><br \/>\n<i>gdrive               drive<\/i><\/p>\n<p><i>e) Edit existing remote<\/i><br \/>\n<i>n) New remote<\/i><br \/>\n<i>d) Delete remote<\/i><br \/>\n<i>r) Rename remote<\/i><br \/>\n<i>c) Copy remote<\/i><br \/>\n<i>s) Set configuration password<\/i><br \/>\n<i>q) Quit config<\/i><\/p>\n<\/blockquote>\n<p>Выходим<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">e\/n\/d\/r\/c\/s\/q&gt; q<\/code><\/pre><p><b>Rclone<\/b> установлен и настроен<\/p>\n<p>Пробуем скопировать содержимое папки на свой сервер (критично к регистру)<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">rclone copy \/backup\/ gdrive:Backup\/Myserver\/ -P<\/code><\/pre><p>Если всё копируется, то будем настраивать синхронизацию по времени.<br \/>\nТ. к. веста не умеет от рута запускать скрипты, настроим крон сами:<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">sudo nano \/etc\/crontab<\/code><\/pre><p>И в конце файла добавляем следующий код (выполняется каждый день в 4 часа):<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">0 4 * * * root rclone sync \/backup\/ gdrive:Backup\/Myserver\/<\/code><\/pre><p>P.s. <a href=\"https:\/\/losst.ru\/nastrojka-cron\">Настройка Cron<\/a>.<\/p>\n",
            "date_published": "2020-05-08T01:07:30+03:00",
            "date_modified": "2020-05-08T01:29:37+03:00",
            "image": "https:\/\/utata.ru\/pictures\/1.png",
            "_date_published_rfc2822": "Fri, 08 May 2020 01:07:30 +0300",
            "_rss_guid_is_permalink": "false",
            "_rss_guid": "87",
            "_e2_data": {
                "is_favourite": false,
                "links_required": [
                    "system\/library\/highlight\/highlight.js",
                    "system\/library\/highlight\/highlight.css",
                    "system\/library\/jquery\/jquery.js",
                    "system\/library\/fotorama\/fotorama.css",
                    "system\/library\/fotorama\/fotorama.js"
                ],
                "og_images": [
                    "https:\/\/utata.ru\/pictures\/1.png",
                    "https:\/\/utata.ru\/pictures\/2.png",
                    "https:\/\/utata.ru\/pictures\/3.png",
                    "https:\/\/utata.ru\/pictures\/4.png",
                    "https:\/\/utata.ru\/pictures\/5.png",
                    "https:\/\/utata.ru\/pictures\/6.png",
                    "https:\/\/utata.ru\/pictures\/7.png",
                    "https:\/\/utata.ru\/pictures\/8.png",
                    "https:\/\/utata.ru\/pictures\/9.png",
                    "https:\/\/utata.ru\/pictures\/10.png",
                    "https:\/\/utata.ru\/pictures\/11.png",
                    "https:\/\/utata.ru\/pictures\/12.png",
                    "https:\/\/utata.ru\/pictures\/13.png",
                    "https:\/\/utata.ru\/pictures\/14.png",
                    "https:\/\/utata.ru\/pictures\/15.png"
                ]
            }
        }
    ],
    "_e2_version": 3877,
    "_e2_ua_string": "E2 (v3877; Aegea)"
}