-1

I am using Rancher, and I am doing a backup from my DB (mysql), using the code:

mysqldump -u atom -p -c atom > /var/lib/mysql/backup20190724.sql

Now, I need to copy this SQL script and send it to the developer team.

I was trying to look the file using CAT code:

cat /var/lib/mysql/backup20190724.sql

and then I was planning on copying and paste the code to my notepad, so I can save it and send it.

I am really, really new to all of this, but what is happening is that my sql code has more lines then the shell can show me. And even if i try to see from 100 to 100 lines from it, it does not work, because it looks like some part of the sql code shows only half of it (like it does not have a number of fixed lines).

Does anyone have a clue on how can I do this?

  • It's likely that your MS based terminal has a minimum "length" defined for its screen buffer scroll back Open the 'Properties' menu and change the height to 9999. Then you have the biggest scrollback allowed. Not really a programming Q. IN the future such Qs should be posted to https://superuser.com . lease read [Help On-topic](https://stackoverflow.com/Help/On-topic) and [Help How-to-ask](https://stackoverflow.com/Help/How-to-ask) before posting more Qs here. Good luck. – shellter Aug 20 '19 at 16:33

2 Answers2

1

Your best bet here is going to be an FTP client. Download something like FileZilla and enter your servers connection strings. Once you connect to your server, copy /var/lib/mysql/backup20190724.sql to somewhere on your local machine.

FileZilla link: https://filezilla-project.org/

Another option is to use sendmail or postfix to email the file to you from the command line. Though this is a bit more in depth and likely involves configuring mail utils if you haven't already. FTP really is going to be your easiest route, but if you'd like instructions on the email route, let me know what operating system and web server your using and I'll do my best to provide instructions.

kenef
  • 183
  • 10
0

If you can SSH to the node where the Docker container is running (nevertheless is Kubernetes or Rancher), and once determined the related container, you can use the docker cp command.

"docker cp" requires exactly 2 arguments.
See 'docker cp --help'.

Usage:  docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-
    docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH

Copy files/folders between a container and the local filesystem

So you can do something like this:

docker cp <container_sha>:/var/lib/mysql/backup20190724.sql /node/path/of/your/dump.sql
prometherion
  • 2,119
  • 11
  • 22