Open Yury-MonZon opened 8 years ago
Yes, it is possible to upload other files rather than .mp4. To support it you should remove an operator 'if' for mp4 in GDriveUploader script:
line 100 remove: && [ "$(echo -n $n | tail -c 4)" = ".mp4" ]
line 130 remove: if [ "$(echo -n $n | tail -c 4)" = ".mp4" ]; then
line 133 remove: fi
But I don't recommend to do this. When your camera is working it creates and removes temporary files (other than mp4). It will cause the problem that you will see unuseful files in your Google Drive folder.
You shouldn't put anything additional in the /home/hd1/record/. Camera is waiting for new folders in that folder, so when it see something in that folder it creates a folder with the same name in your Google Drive folder.
What if I change the line [ "$(echo -n $n | tail -c 4)" = ".mp4" ]
to [[ "$(echo -n $n | tail -c 4)" = ".mp4" ] || [ "$(echo -n $n | tail -c 4)" = ".log" ]]
. I'm not a bash coder at all, please, correct me - I'm guesstimating with my C knowledge here. So will it work for *.log as well?
About folders stuff - can't I create /home/hd1/record/log folder and put all my logs in here, so they will be synchronised?
It is better to create additional scripts to upload other stuff in parallel.
Thanks!
What if my script is going to create a folder with every_time_new_random_name and log file inside it every time I need it? will your script detect it?
It depends on the folder name. Every time your script creates a folder it have to use the name like: 2016Y10M22D18H_log
Where "2016Y10M22D18H" is the current year, month, day and hour. This folder will be uploaded when 19 hour starts.
Is it possible to add support for automatic upload of files other than *.mp4? It could be very useful to upload some stats - uptime, free space etc...
I've put text.txt in the /home/hd1/record/ and it didn't got uploaded to GDrive, instead it created the folder named text.txt in GDrive.