Cutinplace.sh
Aus VDR Wiki
(Unterschied zwischen Versionen)
Zeile 2: | Zeile 2: | ||
#!/bin/sh | #!/bin/sh | ||
# | # | ||
− | # | + | # cutinplace.sh - v.0.1 |
+ | # | ||
+ | # add this line to your reccmds.conf: | ||
+ | # folgende zeile in die reccmds.conf eintragen: | ||
+ | # | ||
+ | # cutinplace (at) : /usr/local/bin/cutinplace -at | ||
+ | # cutinplace : /usr/local/bin/cutinplace -start | ||
− | + | MAX_IN_MB="500" | |
+ | case "${1}" in | ||
+ | -at) | ||
at now <<EOF | at now <<EOF | ||
− | svdrpsend.pl MESG "Editing process started" | + | /usr/local/bin/svdrpsend.pl MESG "Editing process started" |
− | cutinplace "${ | + | /usr/local/bin/cutinplace "${2}" |
− | svdrpsend.pl MESG "Editing process finished" | + | /usr/local/bin/svdrpsend.pl MESG "Editing process finished" |
EOF | EOF | ||
+ | ;; | ||
+ | -start) | ||
+ | VAR=$(($(find "${2}" -printf %k+)0)) | ||
+ | test "$((VAR / 1024))" -gt "${MAX_IN_MB}" && { | ||
+ | echo "Record to large ($((VAR / 1024))Mb -gt ${MAX_IN_MB}Mb), use better at..." | ||
+ | } || { | ||
+ | /usr/local/bin/cutinplace "${2}" | ||
+ | } | ||
+ | ;; | ||
+ | esac | ||
</pre> | </pre> | ||
[[Kategorie:Scripts]] | [[Kategorie:Scripts]] |
Version vom 22. November 2004, 12:19 Uhr
#!/bin/sh # # cutinplace.sh - v.0.1 # # add this line to your reccmds.conf: # folgende zeile in die reccmds.conf eintragen: # # cutinplace (at) : /usr/local/bin/cutinplace -at # cutinplace : /usr/local/bin/cutinplace -start MAX_IN_MB="500" case "${1}" in -at) at now <<EOF /usr/local/bin/svdrpsend.pl MESG "Editing process started" /usr/local/bin/cutinplace "${2}" /usr/local/bin/svdrpsend.pl MESG "Editing process finished" EOF ;; -start) VAR=$(($(find "${2}" -printf %k+)0)) test "$((VAR / 1024))" -gt "${MAX_IN_MB}" && { echo "Record to large ($((VAR / 1024))Mb -gt ${MAX_IN_MB}Mb), use better at..." } || { /usr/local/bin/cutinplace "${2}" } ;; esac