vitalif/grive2

Is it possible to just upload files ?

Opened this issue · 2 comments

Hi,

im using grive to send the recordings of my Camera from my FTP Server to Google Drive. Sadly my camera is recording in subfolders like this.

2021\month\day

So my idea was to just upload the recordings (.jpg and .mp4) without all the subfolders. So i could just open my Google Drive and see the recordings. The recodings are also named like 20211510_time.mp4 so its easy to find which recording belongs to which date.

I don't know how to do this with grive, but a simple bash script could move all the mp4's to a single directory and delete all the original directories.

This is ONLY an example. Have proper backups, at your own risk, etc.

first have a directory you want to move them to: mkdir ~/grive/cameravids

then something like:

#!/bin/bash
find ~/grive/2021 -iname "*.mp4" -exec mv {} ~/grive/cameravids \;
rm -rf ~/grive/2021

You could just run that after uploading. I want to emphasize that I'm a novice at scripts. Please make sure you have backups of your vids until you have this figured out. I think this should search recursively through a folder named 2021 within your grive folder and move all mp4s (regardless of how deeply they are buried) into a single directory ~/grive/cameravids and then delete the ~/grive/2021 directory and all of its subdirectories. Adjust as necessary.

Hi,

yeah thats what i did after asking here. I solved it with this little script

#!/bin/bash
find /Kamera* -mtime +7 -exec rm {} ;
find /Kamera -type f ( -iname *.mp4 -o -iname *.jpg ) -exec mv -it /Kamera {} +
rm -r /Kamera/202*
rm -r /Kamera/*.jpg
cd / && grive --id XXXXXXXXX --secret XXXXXXX -s Kamera
exec bash

Thank you for helping :) Would be a great feature at least for me to get that function directly into grive :)