Roland0 wrote: 
> > 
Code:
--------------------
  >   > 
  > outtime=$(stat -c"%Y" "$outfile") && intime=$(stat -c"%Y" "$infile")
  > if [ -n "$outtime" ] && [ "$intime" -ne "$outtime" ]; then 
  > 
--------------------
> > 
> will reduce file accesses.


I had to change the logic slightly, because I want the
transcoding/editing/copying to take place if either the source and
target files have different timestamps, or the target file doesn't
exist.  So my test is as follows:


Code:
--------------------
        outtime=$(stat -c"%Y" "$outfile") && intime=$(stat -c"%Y" "$infile")
        if [ -z "$outtime" ] || [ "$intime" -ne "$outtime" ]; then      
  
--------------------


So I think I'm done now.  I will set up my spare Pi Zero W as follows:
- use cron to backup my main library, which is mounted as a network
share from my main Pi 3B+.  It'll use rsync to another hard disk
attached to the Zero, and will exclude group, owner and permission
checks, as well as allowing for timestamps to be up to 1 second
different.
- run my script to update my compressed library, which is in a separate
folder on the backup disk, from this backup.

This will ensure that my backup and my compressed copy are always up to
date.  I can then occasionally rsync the compressed copy to the MicroSD
card in the 3A+ in my camper van.

I'm a happy camper now :).  Thanks for the advice and tips in this
thread - most appreciated.


------------------------------------------------------------------------
chill's Profile: http://forums.slimdevices.com/member.php?userid=10839
View this thread: http://forums.slimdevices.com/showthread.php?t=110496

_______________________________________________
ripping mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/ripping

Reply via email to