This program just to backup all apache22 in the freebsd system to a .tar.gz file with date.
source code:
#!/usr/bin/env python
import os
import datetime
today= datetime.date.today().isoformat()
cmdtar = "tar -C /usr/local/www/ -cvf /usr/home/sino/source_bakup/apache22_"+today+".tar apache22"
cmdgz = "gzip /usr/home/sino/source_bakup/apache22_"+today+".tar"
print cmdtar
os.system(cmdtar)
print cmdgz
os.system(cmdgz)
source code:
#!/usr/bin/env python
import os
import datetime
today= datetime.date.today().isoformat()
cmdtar = "tar -C /usr/local/www/ -cvf /usr/home/sino/source_bakup/apache22_"+today+".tar apache22"
cmdgz = "gzip /usr/home/sino/source_bakup/apache22_"+today+".tar"
print cmdtar
os.system(cmdtar)
print cmdgz
os.system(cmdgz)