Select Page

Art of BI: Migrating files using SCP on Linux or Unix

Author: Bill Anderson | | April 28, 2016

Here’s a short blog post as a quick reference for some of the ways to move files using the terminal window for Linux/Unix using the SCP cmd. For this example we will be moving files and directories from a Dev environment onto a TST environment.

As an example, let’s walk through how to copy the file nohup.log from the ./start_stop directory in DEV to a directory into TST:

[code language="bash"]
scp /mp01/ancillary/start_stop/no_hup.log <user_name>@<server_name>:/mp01/ancillary/start_stop/
[/code]

– Be sure to add a forward slash for the target folder because if not it may interpret it as the name of a file that you are writing to.

– You will be asked to enter the password of the TST (Going to) userName from the system. This will not run if the password is incorrect.

To copy all files with the same file type .py from the start_stop directory from DEV to a directory in TST:

[code language="bash"]
scp <user_name>@<server_name>:"/mp01/ancillary/start_stop/*.py" /mp01/ancillary/start_stop/
[/code]

– You will be asked to enter the password of the DEV (Source) userName from the system. This will not run if the password is incorrect.

To copy the entire directory start_stop from Dev to a directory in TST:

[code language="bash"]
scp -r <user_name>@<server_name>:/mp01/ancillary/start_stop /mp01/ancillary/
[/code]

– You will be asked to enter the password of the DEV (Source) userName from the system. This will not run if the password is incorrect.

– The key here is to use the “-r” switch for copying an entire folder directory

In the end, one should always use the “man” command, for example “scp man”, from the terminal prompt to get all the information about the programs on which they have questions.

How to Solve the Oracle Error ORA-12154: TNS:could not resolve the connect identifier specified

The “ORA-12154: TNS:could not resolve the connect identifier specified” Oracle error is a commonly seen message for database administrators.

Vijay Muthu | February 4, 2021

Using Nulls in DB2

If a column “value” can be null, it can mean one of two things: the attribute is not applicable for certain occurrences of the entity, or the attribute applies to all entity occurrences, but the information may not always be known.

Craig Mullins | April 6, 2015

MongoDB Best Practices: Design, Deployment & More

This post provides a rundown of best practices to use when running MongoDB.

Esayas Aloto | February 28, 2017

Subscribe to Our Blog

Never miss a post! Stay up to date with the latest database, application and analytics tips and news. Delivered in a handy bi-weekly update straight to your inbox. You can unsubscribe at any time.

Work with Us

Let’s have a conversation about what you need to succeed and how we can help get you there.

CONTACT US

Work for Us

Where do you want to take your career? Explore exciting opportunities to join our team.

EXPLORE JOBS