dragon_0n3
Dabbler
- Joined
- Jun 2, 2016
- Messages
- 12
Hello, Everyone!
You're probably rolling your eyes just by reading the title...
I've been searching the webz for solution or something remotely similar to what i'm trying for weeks; i came up with *something*, but am still stomped on a couple of things.
Running 9.3-stable as a plex server, i wanted to automate through cron jobs these processes:
1. stop the plex service
2. delete channel cache folders/data
3. restart plex service
i am able to perform 1 & 3 via simple cron job by these commands as root:
a. to stop jexec plexmediaserver_1 service plexmediaserver onestop
b. to restart jexec plexmediaserver_1 service plexmediaserver onestart
However, if i put these lines in a script (clear_plex_cache.sh):
jexec plexmediaserver_1 service plexmediaserver onestop
sleep 5
rm -Rf /mnt/Data1/jails/plexmediaserver_1/var/db/plexdata/Plex Media Server/Plug-in Support/Caches
sleep 5m
jexec plexmediaserver_1 service plexmediaserver onestart
Place the script in /bin, then run the cron with "find /bin --exec clear_plex_cache.sh" nothing happens.
So far, i can stop/restart the service, then delete the cache folders manually via ftp connection, but if i could automate the process, then i'd be that much close to multimedia nirvana!
Thanks for reading, and hope whatever comes out of this will help someone else in the future!
You're probably rolling your eyes just by reading the title...
I've been searching the webz for solution or something remotely similar to what i'm trying for weeks; i came up with *something*, but am still stomped on a couple of things.
Running 9.3-stable as a plex server, i wanted to automate through cron jobs these processes:
1. stop the plex service
2. delete channel cache folders/data
3. restart plex service
i am able to perform 1 & 3 via simple cron job by these commands as root:
a. to stop jexec plexmediaserver_1 service plexmediaserver onestop
b. to restart jexec plexmediaserver_1 service plexmediaserver onestart
However, if i put these lines in a script (clear_plex_cache.sh):
jexec plexmediaserver_1 service plexmediaserver onestop
sleep 5
rm -Rf /mnt/Data1/jails/plexmediaserver_1/var/db/plexdata/Plex Media Server/Plug-in Support/Caches
sleep 5m
jexec plexmediaserver_1 service plexmediaserver onestart
Place the script in /bin, then run the cron with "find /bin --exec clear_plex_cache.sh" nothing happens.
So far, i can stop/restart the service, then delete the cache folders manually via ftp connection, but if i could automate the process, then i'd be that much close to multimedia nirvana!
Thanks for reading, and hope whatever comes out of this will help someone else in the future!