Phifer wrote:Looked again when I got home. Looks like it only keeps the most recent log. These were completed with Cron. I am rebooting now and will look again in the morning. I have also pasted the scripts in case you see anything that needs fixed.
Code: Select all
-rw-r--r-- 1 admin administ 0 Mar 5 18:52 /tmp/-sh.ran
-rw-r--r-- 1 admin administ 0 Mar 5 22:28 /tmp/remove.sh.ran
-rw-r--r-- 1 admin administ 0 Mar 5 22:30 /tmp/ts.sh.ran
This is correct, it only records the "last" time it was run. If you want to log it to a file, then that is more complicated. If you log to the RAMdisk you could overfill the RAMDisk, causing a "crash", while if you log it to the HDD's, then it will "wake up the drives" which would prevent "spindown". My method while only saving the date/time of the "last run" (ran), consumes no space, as it is a zero-byte file, that merely consumes space for the filename/date/time which is merely a few bytes, which is therefore unlikely to overfile your RAMDisk.
Phifer wrote:
ts.sh
Code: Select all
#!/bin/sh
#
# Filebot Cleanup script
#
/share/CACHEDEV1_DATA/.qpkg/Optware/bin/filebot -script fn:amc --output "/share/Multimedia" --log-file amc.log --action move --conflict override --def music=y --def subtitles=en --def artwork=y --def clean=y --def plex=localhost:Vtsm5xKx1g7hz4 -non-strict "/share/Download/transmission/completed" --def excludeList=amctrans.txt
#
/bin/touch /tmp/$(/usr/bin/basename $0).ran
#done
remove.sh (removes finished torrents from transmission so filebot can move them without error)
Code: Select all
# !/bin/sh
# script to check for complete torrents in transmission folder, then stop and move them
# get torrent list from transmission-remote list
# delete first / last line of output
# remove leading spaces
# get first field from each line
TORRENTLIST=`transmission-remote -n admin:admin -l | sed -e '1d;$d;s/^ *//' | cut -s -d " " -f1`
# for each torrent in the list
for TORRENTID in $TORRENTLIST
do
echo "Checking torrent ID $TORRENTID..."
STARTED=`transmission-remote -n admin:admin -t $TORRENTID -i | grep "Id: $TORRENTID"`
echo " - started state = $STARTED"
COMPLETED=`transmission-remote -n admin:admin -t $TORRENTID -i | grep "Finished"`
echo " - completed state = $COMPLETED"
if [ "$STARTED" != "" ]; then
echo "Torrent #$TORRENTID is started"
if [ "$COMPLETED" = "" ]; then
echo "Torrent #$TORRENTID is still running"
else
echo "Torrent #$TORRENTID is $COMPLETED"
transmission-remote -n admin:admin -t $TORRENTID --stop
transmission-remote -n admin:admin -t $TORRENTID --remove
fi
fi
done
/bin/touch /tmp/$(/usr/bin/basename $0).ran
I don't need to worry about this issue. I "hardlink" my files from my
Transmission "
Completed" folder to my
Multimedia share, so that I can play with them immediately (
even if they are still seeding). I can then delete them in Transmission at my own whim, as they are already in my
Movie folder (within my
Multimedia share)
ie:
Code: Select all
ln /share/Download/transmission/completed/MyCoolMovie.mp4 /share/Multimedia/Video/Movies/HD/MyCoolMovie.mp4
Because I "
hardlink" the files, I can delete either filename, and the file stays where it is. Also because I "
hardlink" rather than "
copy" the files, they consume no additional space whatsoever. Also you can "
hardlink" a file of
any size in
0.1secs. If you "
copy" them, then you are in fact making a second copy, so it has to "
copy" the entire file "
contents" of the file, rather than just creating a secondardy "
filename" for the exact same physical file. This is particularly useful with large files like
BD Rips. It takes a while to "
copy" a
25GB file, even on my
TS-470 Pro. A hardlink is "
instant"!
Understanding the subtle differences between the "
cp"
(copy), "
mv"
(move), and "
ln"
(link) commands and using each one
appropriately can greatly improve your life. Similarly understanding the differences between a "hardlink" and a "symlink" and using these appropriately is also important. If you don't understand the differences, you should
not attempt to emulate my method; using these inappropriately can cause data loss.
Be particularly careful not to place files in your RAMDisk by accident, as this will crash the NAS if you overfill it. When it doubt you can use the "
df -h" command to check it. For example you probably don't know that "
/var/log" is part of the RAMDisk, but you can verify this at your end with:
This command will return:
Code: Select all
df -h /var/log
Filesystem Size Used Avail Use% Mounted on
none 200M 150M 51M 75% /
The NAS runs off a RAMDisk, so the root directory (
/) of the filesystem is in fact a RAMDisk.
It's a pity
File Station doesn't provide a method of creating "
hardlinks" nor "
symlinks".