Python or Java or "X" from me and my little job

Ben Thomas bthomas at trey-industries.com
Tue Sep 14 13:50:38 EDT 1999


Wow! I better get some knowledge on shell scripts too. Good grief, starting out at
square one again. Well, I almost have the script written in Python, after that I
will write a shell script and compare it. Thanks for the help.

Ben



Cedric Adjih wrote:

> Ben Thomas <bthomas at trey-industries.com> wrote:
> > Actually I just want to
> > 1)get current date and come up with its string like: 01251999
> > 2)zip some files and name the archive 01251999
> > 3)ftp the archive off site
> >
> > this is my first task but I know there will be others. It isn't hard to code
> > I am just new to Python.
>
>   Well if all you need to do is that simple, maybe sticking
> with shell scripts would do. For instance:
>
> #! /bin/sh
> FILENAME=archive-`date +"%Y-%m-%d"`.zip
> FILELIST=`find /home/mydir -type f -mtime 1`
> zip -r $FILENAME $FILELIST || exit 1
> ncftpput -u thomas -p MYPASSWRD ftp.myserver.net /home/thomas $FILENAME
>
> You need to read the man pages for each of the programs, and are better
> using the standard "tar" + "gzip" if you compress files for Unix only
> (using something like "tar -czvpf $FILENAME $FILELIST")
> You can do more complicated change checking using 'md5sum', 'sort',
> 'comm' etc...
> Only after that you might want to switch to Python :-)
>
> -- Cedric
> Not speaking for INRIA.





More information about the Python-list mailing list