Sometimes you are on a server where you generate export file. It’s easy
scp the file from the server to your local machine.
scp [email protected]:/tmp/myfile.csv /tmp/local_folder/
But some times you are dealing
with a situation where you can
ssh but you cannot
(AWS Elastic Beanstalk is a good example)
If the file don’t contain private data (passwords, emails) what you can do is email the file on your work email.
muttmail command (simple mailng inteface supporting attachment files)
- compress your file / folder
- send file attachment with with
echo "mail body" | mutt -a file -s "Subject" -- [email protected]
## install mutt command: # # sudo apt-get install mutt # sudo yum install mutt # Given we have generated `views.csv` file gzip views.csv echo "mail body" | mutt -a views.csv.gz -s "MyApp view stat files" -- [email protected] # Given we mupltiple files in directory `views/` tar -zcvf views.tar.gz views/ du -sh views.tar.gz echo "mail body" | mutt -a views.tar.gz -s "MyApp view stat files" -- [email protected]
Warning I do recommend to encrypt the file before sending
zip -P password file.zip file # ...or: zip -e file.zip file # ...or: gpg -o fileToTar.tgz.gpg --symmetric fileToTar.tgz # to decrypt gpg fileToTar.tgz.gpg
Entire blog website and all the articles can be forked from this Github Repo