Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: uploading not *.mp4 files #1

Open
Yury-MonZon opened this issue Oct 21, 2016 · 5 comments
Open

Feature request: uploading not *.mp4 files #1

Yury-MonZon opened this issue Oct 21, 2016 · 5 comments

Comments

@Yury-MonZon
Copy link

Yury-MonZon commented Oct 21, 2016

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.

@Yury-MonZon Yury-MonZon changed the title Feature request Feature request: uploading not *.mp4 files Oct 21, 2016
@porunov
Copy link
Owner

porunov commented Oct 21, 2016

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.

@Yury-MonZon
Copy link
Author

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?

@porunov
Copy link
Owner

porunov commented Oct 21, 2016

  1. Yes. But without additional brackets. It must be like this:
    [ "$(echo -n $n | tail -c 4)" = ".mp4" ] || [ "$(echo -n $n | tail -c 4)" = ".log" ]
  2. Unfortunately, no. It won't work. It will upload or files in the folder 'log' and then continue to upload other folders. It won't return back to 'log' folder again.

It is better to create additional scripts to upload other stuff in parallel.

@Yury-MonZon
Copy link
Author

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?

@porunov
Copy link
Owner

porunov commented Oct 22, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants