Changed touch of backup tmpfile to open(). Changed date system call to localtime(). Added check for device being out of space.