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


_______________________________________________
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list

Reply via email to