tc101
August 10th, 2007, 10:23 PM
I want to write a backup program using linux. This is mostly a learning exercise. The best way for me to learn a language is to start doing things with it. I wrote a simple web crawler in python and learned a lot. This is the next step.
I have a linux shell script now that does some backup:
sudo mkdir /home/backup/wkbackup
sudo tar -cf /home/backup/wkbackup/D_backup$(date +"%Y%m%d").tar /home/tomcarr/D
I would like to just translate this into python to start. I am having trouble with just the first line, trying to make a work directory. Can someone point me to where in the online references it shows how to use mkdir, or better yet, some example code showing how to do things similar to this.
I have a linux shell script now that does some backup:
sudo mkdir /home/backup/wkbackup
sudo tar -cf /home/backup/wkbackup/D_backup$(date +"%Y%m%d").tar /home/tomcarr/D
I would like to just translate this into python to start. I am having trouble with just the first line, trying to make a work directory. Can someone point me to where in the online references it shows how to use mkdir, or better yet, some example code showing how to do things similar to this.