On Fri, 1 Nov 2024, American Citizen wrote:

The bash script is listed below, in case you want to try it out on your linux machine. In making these mp4 videos, I discovered that sometimes not all 240 frames are in the cache area, so I go with what I have.

----------- make-GOES-video.sh -----------

tag=`date +"%Y-%m-%d %H:%M:%S.%N" | md5sum | cut -c1-32`
strt=`date +"%s"`
echo "This bash script only works for GOES-R full disk jpeg files 1808x1808 pixels in size"
bld="/home/owner/Desktop/tmp"

if [ ! -d $bld ] ; then
  mkdir $bld
fi

## Cleanup temporary processing folder
cd $bld
ls * | sed "s/^/rm /" > tmp000.$tag
bash tmp000.$tag

Have you considered using mktemp rather than having statically named temporary directories and files?

export TMPDIR=$(mktemp -d)
temp0=$(mktemp)
temp1=$(mktemp)
... etc ...

See the mktemp(1) man page for an explanation of why I set the TMPDIR variable that way.

It might not be worth it on a single-user workstation or when you're 100% sure the script will never be run simultaneously with itself. But I've found that using mktemp is a good habit, over the long haul.

--
Paul Heinlein
[email protected]
45°22'48" N, 122°35'36" W

Reply via email to