Skip to content

Interrupt or unclean shutdown: renamed files may stay not renamed back on remote side #1

@olecom

Description

@olecom

!sh ../etc/rename_files_pre.sh $DATAEXT $PREEXT || exit

repeat --until-ok -d $SYNCTIME put -E go && echo put_ok
rm go
!sh ../etc/rename_files_pre.sh $DATAEXT $PREEXT || exit
mput -c -E *$DATAEXT$PREEXT # interrupt here
 # files are left unrenamed and this file will be overridden by next 'go'
source rename_remote_norm.lftp
!rm rename_remote_norm.lftp

rename_files_pre.sh handles such case only if there are no new files with $DATAEXT

for f in *$1
do case $f in
    "*"*) # no DATAEXT files, list DATAEXT PREEXT prefixed, if any
        for f in *$1$2
        do  case $f in
            "*"*) exit 1;;
            *) echo "mv $f ${f%$2}";;
            esac
        done
        exit
    ;;
    *)  mv "$f" "$f$2"
        echo "mv $f$2 $f"
    ;;
    esac
done

Thus after any unclean shutdown empty/repair 'go' cycle must be done in first place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions