Jika Anda mempunyai Server sendiri atau VPS maka Anda akan berpikir bagaimana cara membackup server Anda agar tidak aman jika terjadi masalah. Jika Anda ingin membackup server tentu Anda harus memiliki space tersendiri di server yang berbeda dan pastinya tidak akan menyimpan backup di server yang sama. Menyimpan backup di server yang sama itu tidak ada artinya. Jadi cara termudah dan gratis yaitu melakukan backup ke Google Drive. Google Drive sendiri gratisnya 15GB, jika Anda ingin space yang lebih besar bisa membeli layanan Gsuite atau membeli akun gdrive unlimited yang banyak dijual di luaran sana.
Berikut adalah cara untuk bisa menggunakan gdrive command di Linux.
1. Login ke SSH dan jalankan perintah berikut untuk download versi linux dari Github.
1 2 |
cd ~ wget -O gdrive https://docs.google.com/uc?id=0B3X9GlR6EmbnWksyTEtCM0VfaFE&export=download |
2. Ganti permission file gdrivenya.
1 |
chmod +x gdrive |
3. Install file ke folder usr.
1 |
sudo install gdrive /usr/local/bin/gdrive |
4. Anda harus memberi tahu Google Drive untuk mengizinkan program ini terhubung ke akun Anda. Untuk melakukan ini, jalankan program gdrive dengan parameter apa pun dan salin teks yang diberikannya ke browser Anda. Kemudian copy ke SSH Anda kode respons yang Google berikan kepada Anda.
1 |
gdrive list |
5. Selesai, Anda bisa melakukan upload dengan perintah berikut.
1 |
gdrive upload backups.tar.gz |
Berikut adalah daftar perintah Google Drive
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
gdrive [global] list [options] List files gdrive [global] download [options] <fileId> Download file or directory gdrive [global] download query [options] <query> Download all files and directories matching query gdrive [global] upload [options] <path> Upload file or directory gdrive [global] upload - [options] <name> Upload file from stdin gdrive [global] update [options] <fileId> <path> Update file, this creates a new revision of the file gdrive [global] info [options] <fileId> Show file info gdrive [global] mkdir [options] <name> Create directory gdrive [global] share [options] <fileId> Share file or directory gdrive [global] share list <fileId> List files permissions gdrive [global] share revoke <fileId> <permissionId> Revoke permission gdrive [global] delete [options] <fileId> Delete file or directory gdrive [global] sync list [options] List all syncable directories on drive gdrive [global] sync content [options] <fileId> List content of syncable directory gdrive [global] sync download [options] <fileId> <path> Sync drive directory to local directory gdrive [global] sync upload [options] <path> <fileId> Sync local directory to drive gdrive [global] changes [options] List file changes gdrive [global] revision list [options] <fileId> List file revisions gdrive [global] revision download [options] <fileId> <revId> Download revision gdrive [global] revision delete <fileId> <revId> Delete file revision gdrive [global] import [options] <path> Upload and convert file to a google document, see 'about import' for available conversions gdrive [global] export [options] <fileId> Export a google document gdrive [global] about [options] Google drive metadata, quota usage gdrive [global] about import Show supported import formats gdrive [global] about export Show supported export formats gdrive version Print application version gdrive help Print help gdrive help <command> Print command help gdrive help <command> <subcommand> Print subcommand help |