Thanks, just didn't want some newbie thinking 'Hey, great, I have a backup program, now my computer is foolproof.'. Like I said, no offence meant.
Originally Posted by lonewaster
Some of the main issues:
- Doesn't check if it has root permissions
- Doesn't check if they entered a valid username
- Changes the permissions on the backup
- What do you gain by changing permissions?
- The backup archive is open to anyone - minor security risk
- When you restore from the backup, the whole system is open to anyone - major security risk
- The sleep statements serve no purpose
- Probably want to look into excluding the gvfs file
- Might want to look into rsync - it considerably speeds up backups
Also, you are putting the backup in ~/backup.tgz and then excluding /backup.tgz from the backup (not the same file). You really should make the backup at /backup.tgz:
Then you won't have to worry about asking for a username either.
sudo tar cvpzf /backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys --exclude=/media /