#!/usr/bin/python
#filename: ssu.py
#|------------------------------------------------------------------------------|
#| Created by: Thomas M. Crowe |
#| Date November 29 2006 |
#| Version 1.0.1 |
#| |
#| Covered by GPL license |
#| |
#| |
#| |
#| |
#| Please email any errors to: tommy18crowe@gmail.com |
#|------------------------------------------------------------------------------|
import os
print
print "Welcome to User Account Set up"
print
print "Please select an option"
print "for Help press: h"
print "To create 'bin' in your Home directory press: 1"
print "To create 'source' in your Home directory press: 2"
print "To create 'backup' in your Home directory press: 3"
print "To create '/var/backup'(requires root) press: 4"
print "To backup your home directory to your backup directory press: 5"
print "To backup your Home directory to '/var/backup'(requires root): press 6"
print "To Quit: press Q"
option = None
while option != 'q':
option = raw_input(":")
if option == 'h':
print "This program was created for the purpose of both backing up and creating vital directories that will assist you. The 'bin' directory is where you will put your shell commands. It is recommended that you add this to your command PATH by running the command ''PATH=""~/bin""''. the source directory is where you place your source programs for compiling. Both the $HOME/backup and /backup are where you will backup you home directory to. The 2 commands ''back up home directory to your backup, and ''back up home directory to ''/backup'' is for backing up everything with in your home directory. "
elif option == '1':
os.chdir(os.path.expanduser("~"))
os.mkdir("bin")
elif option == '2':
os.chdir(os.path.expanduser("~"))
os.mkdir("source")
elif option == '3':
os.chdir(os.path.expanduser("~"))
os.mkdir("backup")
elif option == '4':
os.chdir(os.path.expanduser("/var"))
os.mkdir("backup")
elif option == '5':
os.spawnlp(os.P_WAIT, 'tar', 'tar', 'cvfz', os.path.expanduser('~/backup/bavkup.tar.gz'), os.path.expanduser('~'))
elif option == '6':
os.spawnlp(os.P_WAIT, 'tar', 'tar', 'cvfz', '/var/backup/bavkup.tar.gz', os.path.expanduser('~'))
else:
print "All done."