image

Delete Orphan Render in Unity

[<Back>] [<Edit>]

Looks/Delete for Orphan Render in an Avid MediaNet Unity environment

#!/bin/bash

#Function.sh

eval $(awk 'BEGIN{ print "FILE=$@" }' < /dev/null )
ACCESSED_DATE=$( stat -x "$FILE" | grep "Access" | awk '{print $2,$3,$4,$6}' )
CREATION_DATE=$( stat -x "$FILE"| grep "Modify" | awk '{print $2,$3,$4,$6}' )

if [ "$ACCESSED_DATE" == "$CREATION_DATE" ] && [ -n "$ACCESSED_DATE" ]
    then
        echo $@
        echo "Can Delete"
        #echo "Accessed: "$( stat -x "$FILE" | grep "Access" )
        #echo "Created : "$( stat -x "$FILE"| grep "Modify" )
        #Insert Delete Code Here
        echo $@ >> delete.log
        echo "Access : "$( stat -x "$FILE" | grep "Access" ) >> delete.log
        echo "Created: "$( stat -x "$FILE" | grep "Modify" ) >> delete.log
        #rm -rf "$FILE"
                
    else
        echo $@
        echo "Can't Delete"
        #echo "Accessed: "$( stat -x "$FILE" | grep "Access" )
        #echo "Created : "$( stat -x "$FILE"| grep "Modify" )
fi

//Main Script//

#!/bin/bash

# Orphan.sh

FILE="/Users/hydra/bin/Orphan_Zapper/renders.txt"
LOOP=1
X=1
PARTITIONS=$( eval cat $FILE | wc -l )

while [ $LOOP -lt $PARTITIONS ]
do
    MOUNT=$( eval sed -n $LOOP"p" $FILE)
    mkdir /Volumes/$MOUNT
    mount_avidfs -U username -g WORKGROUP PHILOMN2FC:$MOUNT /Volumes/$MOUNT
    
      /usr/bin/find /Volumes/$MOUNT -type f -atime +30 -exec /Users/hydra/bin/Orphan_Zapper/LookForOrphanFile_Function.sh '{}' ;
    
    /usr/sbin/diskutil umount force /Volumes/$MOUNT
    LOOP=$((LOOP+1))
    sleep 1

done


//partition list//

volumeOne
volumeTwo
volumeThree





By: Ted Simbajon





 
Instagram Stats
pinoy
my Kung Fu