Re: [Evolution] Evolution not listening to quit



Yes, a rename in the same partition should be atomic.

Rather than adding a check after every command, I would recommend simply
adding a call to set -e

and rather than those repeated lines, it can be done with a simple loop:
for i in {5..2}; do 
 rm -f /mnt/tank/users/michelle/backup/mail/$i.tar.gz 
 mv /mnt/tank/users/michelle/backup/mail/$(($i - 1)).tar.gz /mnt/tank/users/michelle/backup/mail/$i.tar.gz
done

(please note that $(( )) is not a feature in POSIX sh, so you would need to change the shebancg from /bin/sh 
to /bin/bash)

although I would generally favor using a date-based filename, rather than numeric ones, and let the user 
occasionally remove the old ones if needed.


Kind regards




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]