Recent Posts
None | 5 sec ago
PHP | 6 sec ago
None | 12 sec ago
None | 22 sec ago
None | 39 sec ago
Python | 1 min ago
PHP | 2 min ago
None | 2 min ago
CSS | 2 min ago
None | 3 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By Anonymous on the 10th of Feb 2010 12:04:10 AM
Download |
Raw |
Embed |
Report
#!/usr/bin/python
# ./backup_script.py filetobackup localdirectory backupname
# example:
# ./backup_script.py /code/ /home/target/ example
import datetime
import time
import ftplib
import os
import sys
filetobackup = sys.argv[1]
localdirectory = sys.argv[2]
backupname = sys.argv[3]
today = datetime.date.today()
command = 'tar czf ' + localdirectory,backupname + '-' + today + '.tar.gz ' + filetobackup
os.system(command)
Submit a correction or amendment below.
Make A New Post