[prev in list] [next in list] [prev in thread] [next in thread]
List: python-list
Subject: Re: Backup a directory
From: "Chris Rebert" <clp () rebertia ! com>
Date: 2008-09-30 22:00:06
Message-ID: 47c890dc0809301500r2845c73cp607d92f1903add87 () mail ! gmail ! com
[Download RAW message or body]
On Tue, Sep 30, 2008 at 1:21 PM, <dudeja.rajat@gmail.com> wrote:
> Hello,
>
>
> I'm looking for a script that creates a backup of a directory but keeps only
> one backup.
> I've tried using all the os modules commands but could not create one.
>
>
> Does any one has any such custom script or function?
You could probably whip one up very easily using the tarfile module
[http://docs.python.org/lib/module-tarfile.html] and shutil.move()
[http://docs.python.org/lib/module-shutil.html]. Just make a new
TarFile of the directory, save it, then replace any previous backup
file using shutil.move()
Good luck, and have fun!
Regards,
Chris
P.S. And if you're on *nix, you might consider just using a shell
script and the 'tar' command. Right tool for the right job and all
that.
--
Follow the path of the Iguana...
http://rebertia.com
>
>
> Thanks and regards,
> rajat
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic