Check if folder is on local or nfs storage

To check whether a folder is definately local or nfs storage.

Simply navigate to the folder via a cd and then run the below command.

df .

This will then display what storage is being used for the folder as we can sometimes see that a nfs mount displays however due to issues it may lose the mount point but still show as visible on a regular df display.


rsync folder with sync

To run an rsync from a remote server to a local one and sync the files.

Run the below command

rsync -avz user@server:/tmp/test /tmp/test

Also you can show a progress option with the below addition

rsync -avz --progress user@server:/tmp/test /tmp/test

And add a bandwidth limiter if needed

rsync -avz --bwlimit=100000 user@server:/tmp/test /tmp/test

Copy files from multiple servers to one server

Below is a script which should allow you to copy multiple files that exist on different servers to one location.

You will need SSH keys setting up if you dont want to enter in the password for each time the request is sent to the server.

Further info here

servers.txt contents

#!/bin/bash -
#          FILE:
#         USAGE:  ./
#   DESCRIPTION:  Copies files on multiple servers to one server from text list of servers hostnames
#       OPTIONS:  The right to remain silent
#          BUGS:  
#         NOTES:  Above^
#        AUTHOR: 
#       COMPANY:
#       CREATED: 18/01/12 13:43:03 BST
#      REVISION: 
servers=$(less servers.txt)
for IP in $servers
scp usernamehere@$IP:/var/log/monitor/file.txt