How to download a file/folder from remote (openshift) to local system
Asked Answered
M

3

8

How to download or backup or to save a copy of a file from openshift remote folder into my local-system folder using rhc client tool? or is there any other way other than rhc client tool to make a backup of it to my local system?

Also, Is there a way to copy an entire folder from remote(openshift) to local?

Menticide answered 31/12, 2014 at 9:49 Comment(1)
I tried this one which helped me., rhc scp app_name download /path/to/local/folder /path/to/remote/folder/file., but how to download a folderMenticide
B
5

Use winscp (if on windows) to ssh into your openshift app. Navigate to your folder. Drag and drop folder or files to local machine.

Filezilla - using filezilla and sftp with openshift

Bailee answered 31/12, 2014 at 15:35 Comment(3)
I use linux. i tried gigolo to connect the openshift remote file system but no sftp support and permission denied error when i click var folder. Is there anything like winscp for linux.Menticide
Try Filezilla on linux.Bailee
I tried filezilla and also found a blog related to filezilla setting up with openshift.... works nice. It seems I accidentally uploaded some files through terminal ., able to view all, delete, retrieve files/folders. Thanks @fatfantasma.Menticide
H
13

First, tar and gzip your folder on the server within a ssh session, the syntax is:

rhc ssh <app_name>
tar czf <name_of_new_file>.tar.gz <name_of_directory>

Second, after you have disconnected from the openshift server (with CTRL-D), download this file to your local system:

rhc scp <app_name> download <local_destination> <absolute_path_to_remote_file>

Then on your local machine you can extract the file and perform your actions.

Humiliation answered 31/12, 2014 at 13:50 Comment(3)
For this "tar czf <name_of_new_file>.tar.gz <name_of_directory>"Menticide
I am trying to run the first command in MongoDB pod on OpenShift with tar czf my_dump.tar.gz dump and it returns tar: Old option g' requires an argument.` I also tried zip -r dump.zip dump and got zip: command not found.Kerrill
Actually, this works from pod terminal in OpenShift Online console: tar czf my_dump.tar.gz dump.Kerrill
B
5

Use winscp (if on windows) to ssh into your openshift app. Navigate to your folder. Drag and drop folder or files to local machine.

Filezilla - using filezilla and sftp with openshift

Bailee answered 31/12, 2014 at 15:35 Comment(3)
I use linux. i tried gigolo to connect the openshift remote file system but no sftp support and permission denied error when i click var folder. Is there anything like winscp for linux.Menticide
Try Filezilla on linux.Bailee
I tried filezilla and also found a blog related to filezilla setting up with openshift.... works nice. It seems I accidentally uploaded some files through terminal ., able to view all, delete, retrieve files/folders. Thanks @fatfantasma.Menticide
Z
3

теперь можно так

copy a pod directory to a local directory:

oc rsync <pod-name>:/opt/app-root/src /c/source

https://docs.okd.io/3.11/dev_guide/copy_files_to_container.html

Zendejas answered 21/5, 2020 at 18:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.