LiveStreamDVR icon indicating copy to clipboard operation
LiveStreamDVR copied to clipboard

Add rclone support for moving files

Open tony-rsrv opened this issue 2 years ago • 22 comments

It would be nice to have older VODs automatically be moved to different storage. rclone supports many different file providers and I believe this would work best for this feature.

tony-rsrv avatar Sep 02 '22 09:09 tony-rsrv

i thought about this when adding ftp support, never used rclone myself so don't really know how it works, but should be possible

MrBrax avatar Sep 02 '22 09:09 MrBrax

https://github.com/sntran/rclone.js

tony-rsrv avatar Sep 02 '22 09:09 tony-rsrv

tiny package it seems like, not really trusting that... i'd rather just use exec like the others

MrBrax avatar Sep 02 '22 09:09 MrBrax

rclone also has a built in API if you'd prefer to access it that way.

tony-rsrv avatar Sep 02 '22 09:09 tony-rsrv

seems to work, cool program with those remote profiles. place rclone.conf in config and specify in the exporter

MrBrax avatar Sep 02 '22 10:09 MrBrax

Weird, pulled the new update from the development branch and I'm not seeing the rclone option.

tony-rsrv avatar Sep 02 '22 11:09 tony-rsrv

are you using the vod or file export menu? because i haven't synced the options on the latter for a while

MrBrax avatar Sep 02 '22 11:09 MrBrax

I see now, but I don't understand the directory and remote fields, can you explain them?

tony-rsrv avatar Sep 02 '22 12:09 tony-rsrv

directory is where on the remote storage you want the file to be stored

remote is the profile you set up via rclone config, you call it something there and then use that inside the exporter

i have only tested this with sftp, not sure if others make separate files

MrBrax avatar Sep 02 '22 12:09 MrBrax

Ah, I'm an idiot, the Docker container didn't have rclone installed.

tony-rsrv avatar Sep 02 '22 13:09 tony-rsrv

i knew i forgot to add something...

MrBrax avatar Sep 02 '22 13:09 MrBrax

Would love some automation with this. Something like a default exporter per channel with a default folder and a default export age. So a cron would check for files created more than x days ago, then export them and then delete them. You can also use rclone move instead of copy which moves the file, checks that the file has been moved, and then deletes the original. Would also be nice to see this reflected somehow in the UI showing that the file is no longer local.

tony-rsrv avatar Sep 02 '22 13:09 tony-rsrv

I also understand this is a lot of work you're putting in so if you have a donation link or something, please let me know!

tony-rsrv avatar Sep 02 '22 13:09 tony-rsrv

i'd need to plan out something, but a status showing whether something has been exported could be useful.

thanks. i've been hesitant to make a donation page because of the need for filing taxes, but i guess i could manage. https://ko-fi.com/mrbrax

MrBrax avatar Sep 02 '22 13:09 MrBrax

Wish I could send more. Love the project!

tony-rsrv avatar Sep 02 '22 14:09 tony-rsrv

Just checked my FTP server and it seems a single quote is being added somewhere that is creating a directory for it on the remote server: https://i.tony.pm/cBL4pqN.png

tony-rsrv avatar Sep 02 '22 14:09 tony-rsrv

Possibly? on this line https://github.com/MrBrax/LiveStreamDVR/commit/977ec8259c2a9a337d8f12e1f47ce19011facaa6#diff-dff74dead61bd3c29d8b26e594cf34f04b7aef20985271a25f448fbcf60cbfe2R39

tony-rsrv avatar Sep 02 '22 14:09 tony-rsrv

probably, but escaping the paths is janky as hell, sometimes it works when it's not escaped and sometimes it doesn't, so i check it beforehand

MrBrax avatar Sep 02 '22 14:09 MrBrax

i can't really find a good test ftp server, probably since nobody really uses it anymore

MrBrax avatar Sep 02 '22 14:09 MrBrax

Just to clarify, SFTP via rclone is where I'm running into the issue. I have a 20TB Hetzner Storage Box in Germany to back up all of my files. In the hosting industry, they're used often.

tony-rsrv avatar Sep 02 '22 14:09 tony-rsrv

Also, adding a button per channel would be nice since rclone supports just passing an entire directory.

tony-rsrv avatar Sep 02 '22 15:09 tony-rsrv

oh ok so not plain ftp then.

i'll probably focus on being able to export a single vod folder instead of just the video file, having a mass option depends on how that will be implemented

MrBrax avatar Sep 02 '22 16:09 MrBrax