Error compressing tar file

Joel Goldstick joel.goldstick at gmail.com
Mon Mar 3 01:43:40 CET 2014


On Mar 2, 2014 7:41 PM, "Joel Goldstick" <joel.goldstick at gmail.com> wrote:
>
>
> On Mar 2, 2014 7:40 PM, "Mike" <miguelcoam at gmail.com> wrote:
> >
> > Hello,
> > I have the script that make a backup file (this process is ok), but now
i wish compress the file on tar file format. But i have problem syntax in
the line of the tar function.
> >
> > The error is
> >
> > [root at master ~]# python bkp_db.py
> >   File "bkp_db.py", line 1
Oops. Remove ) after dumpfile
> >     tar = tarfile.open(dumpfile)+'.tar.gz','w:gz'))
>
> >                                                  ^
> >
> > Note: The 'dumpfile' is the variable for my dump generate with format
db_02-27-14
> >
> > ......
> > tar = tarfile.open(dumpfile)+'.tar.gz','w:gz')
> > tar.add(os.path.join(dumpfile), arcname=dumpfile)
> > tar.close()
> > ........
> >
> > Wath is the correct sintax?
> >
> >
> > Thanks.
> >
> >
> >
> > --
> > https://mail.python.org/mailman/listinfo/python-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20140302/7fd99bac/attachment.html>


More information about the Python-list mailing list