tags:

views:

383

answers:

4

DUPLICATE of: http://stackoverflow.com/questions/17359/

Dear Sir/Madam,

How can I send a zip file (~600MB) to an email account? what is the command line should be used in bash?

What if I want to ftp the files to a server automatically?

Best regards, pat

A: 

It's way better to upload the file through ftp, and send just a link or ftp login.

erenon
+1  A: 

Well, in my opinion 600Mb is too large for e-mail, since some clients and servers will choke on that size. But that's your choice, and if you own the webserver then obviously you can do what you like.

The unix command mail can be used (when configured) to send emails.

You might also want to look at perl's Net::SMTP module, which is for this sort of thing.

Alex Brown
A: 

You can split it up with "split" first, send it with "mail" then concatenate it at the other end with "cat".

Paul Bullough
A: 

Most linux distributions contain a mail command (from the mailx package). You can attach a file from the command line using the -a option:

mail -s 'file attached' -a /path/to/file [email protected]

That said, most mail systems won't be happy with 600MB attachments.

The ncftp package has a number of commands that may be useful for automated transferring of files over FTP, in particular the ncftpput command (see the manpages for more information).

Depending on where you are sending the file, if the other end supports ssh, it might be better to use tools like scp or ssh and rsync. With public key authentication, you don't even have to worry about embedding a password anywhere.

If you are doing backups, consider a tool like Duplicity (but not for a full zip file as it loses most of its advantages) as it supports a number of protocols, performs compression on-the-fly and can perform incremental backups. Oh, and the backups are encrypted and digitally signed to ensure their integrity.

Adam Batkin