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?
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?
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.
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 someone@example.com
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.
You can split it up with "split" first, send it with "mail" then concatenate it at the other end with "cat".