Cara download file dari google drive via ssh
buat file getfile.sh
touch getfile.sh
chmod +x getfile.sh
nano getfile.sh
Copy paste:
#!/bin/bash
fileid="### file id ###"
filename="MyFile.csv"
curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=${fileid}" > /dev/null
curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=${fileid}" -o ${filename}
Ganti fileid dengan id file google.
Ganti filename dengan nama file asli.
fileid didapat dari share file (klik kanan di file, lalu klik Get shareable link), contoh: https://drive.google.com/open?id=1_naou3PopRVlQt9FZJTCGzRKGp306hs8
1_naou3PopRVlQt9FZJTCGzRKGp306hs8 adalah FILEID
Referensi:
https://gist.github.com/tanaikech/f0f2d122e05bf5f971611258c22c110f