Fixed backup script for automation