Dangerous server mod ?
-
Checking on the feasibility and wisdom of some mad plan in my head.
I want to move files from one app (Home Automation) data directory to another app (Emby) data directory.
The apps are containerised so I can't run a script in one to push/pull to another.But I can SCP on desktop and I have tested using rclone on desktop to move the files from source to destination.
However my desktop is not always on so not a good place to make into a cron script.There is a warning when SSH-ing into the cloudron server not to run any updates, and to leave this to the cloudron install. Fully understand and respect this.
But could I add a cron script which would do this sync operation ?
Probably could, but maybe bigger question is : should I ?Maybe it is unwise or even "dangerous" for the health of the cloudron server to have a user script running, even if it is as basic as an rclone/rsync/bash script.
-
@timconsidine if both apps run on the same Cloudron, then you can do a simple file copy via SSH. Each app gets a folder from the host system mounted into the app container. From the app perspective, this is
/app/data
while from the host system this would be/home/yellowtent/appsdata/<appid>/data
So you can just copy things around there, as long as the app can deal with such changes, Emby can for sure. Also you want to restart the app after the copy, just to fixup file permissions if you are unsure how to fix them manually.
-
@nebulon thank you
Yes, this is what I have tested out
Question is more : if I add it to the server logged in via SSH, will I break something ?
Doing it manually is not a good solution, although will live with that if I have to. Would prefer a cron on the server. -
@timconsidine depending on the app, do you think shared volumes between the apps could help here instead of a scheduled copy?
-
-
@nebulon Thanks again for that idea.
I set up a volume which both apps can see.
And Emby as the receiving media player can see files.
I can't get HomeAssistant to write to the volume at the moment.
Permissions seem ok, so investigating.
But great idea, saves file moving etc. -
@timconsidine you can simply use the copy-recursive command to transfer files. If it succeeds delete it from the source. Simply SSH into your box
ssh root@my.yourbox.com
.cp -R \ /home/yellowtent/appsdata/<home-app-id>/data/* \ /home/yellowtent/appsdata/<emby-app-id>/data # then later use the file manager to delete data from home automation, or run rm -rf /home/yellowtent/appsdata/<home-app-id>/data/*