Verbose command cp


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Verbose command cp
# 1  
Old 12-10-2014
Verbose command cp

Hi,

I have sometimes a problem when i want to copy files from a nas, it's the nas which have a problem when it is very requested by a lot of users, the command cp turn and don't stop (the file size does not increase) and it's lock.

Is it possible to verbose this command ?
I try with the flag -v but doesn't work

thank you.

---------- Post updated at 06:02 AM ---------- Previous update was at 01:59 AM ----------

I have found a solution:

Code:
{ cp fileOnNAS fileToLocal 2>&1 & };while [ 1 ];do taille=$(du fileToLocal | awk '{print $1}');echo $taille;sleep 5;taille1=$(du fileToLocal | awk '{print $1}');echo $taille1;if [ $taille1 == $taille ];then break and do something ;fi;done

# 2  
Old 01-02-2015
You might try rsync, which might be better at retrying. A cleaner loop is to save size_last and loop, so there is just one du line. Also, you can use 'read size_var name_var' in place of awk call.
Code:
cp fileOnNAS fileToLocal
export taille1=-1
 
while [ 1 ]
do
 du fileToLocal
 sleep 5
done | while read taille b
do
 if [ "$taille1" = "$taille" ]
 then
  do something and break
 fi
 taille1=$taille
 echo $taille
done

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem in turn verbose on in sftp

Hi, I am trying to turn verbose on for sftp but i get message to look lftp options. SFTP_LOG=`lftp -u $P_USERID,$P_PSWD sftp://$P_HOSTNAME <<EOF cd $P_DEST_DIR mput $P_FILE_PREFIX bye EOF` The above one works fine but i don't see the debugging details\log details. I want... (7 Replies)
Discussion started by: consat
7 Replies

2. UNIX for Dummies Questions & Answers

Unix (compressed archieve, non-verbose)

I'm confusing with this question. :wall: Can any one tell me how to do and use which command? :confused: create a compressed archive of the "Test" directory and it's contents, called Test.tar.gz, and place it in the current directory. Use a non-verbose tar command with a single string, including... (5 Replies)
Discussion started by: wk9031
5 Replies

3. UNIX for Dummies Questions & Answers

passing command output from one command to the next command in cshell

HI Guys, I hope you are well. I am trying to write a script that gets executed every time i open a shell (cshell). I have two questions about that 1) I need to enter these commands $ echo $DISPLAY $ setenv $DISPLAY output_of_echo_$display_command How can i write a... (2 Replies)
Discussion started by: kaaliakahn
2 Replies

4. Shell Programming and Scripting

Need help! command working ok when executed in command line, but fails when run inside a script!

Hi everyone, when executing this command in unix: echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error. here is content of my script: tdbsrvr$ vi hc.sh "hc.sh" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies

5. UNIX for Dummies Questions & Answers

Routing a verbose information to a log file

Hi All, In the script mentioned below uses a sftp command to login to the remote host and pull the files from the remote server. we want to log this inf to a log file . But it is not happening, the verbose information is just displayed on the screen but not to the log file when I run this... (1 Reply)
Discussion started by: raghuveer2008
1 Replies

6. Shell Programming and Scripting

Save cURL verbose output to file or do it like browser "save as.."

hi there ! i have exactly the same problem like this guy here https://www.unix.com/shell-programming-scripting/127668-getting-curl-output-verbose-file.html i am not able to save the curl verbose output.. the sollution in this thread (redirecting stderr to a file) does not work for me.... (0 Replies)
Discussion started by: crabmeat
0 Replies

7. Shell Programming and Scripting

Getting cURL to output verbose to a file

This is about to drive me crazy. What I want to do is simple: output ALL the verbose information from curl to a file I have read the manual, tried several options and searched this forum but no salvation... I'm using curl -k -Q "command" --user user:passwd --ftp-pasv --ftp-ssl -v... (1 Reply)
Discussion started by: caramandi
1 Replies

8. Shell Programming and Scripting

sftp verbose output

We need to use sftp to replace the ftp on all our application scripts. The command itself works, however,the output from the verbose is not giving us a success response with a transfer count. Our processes require that we interrogate the response to ensure the data transfer was successful. ... (2 Replies)
Discussion started by: MizzGail
2 Replies

9. SuSE

inconsistent ls command display at the command prompt & running as a cron job

Sir, I using the following commands in a file (part of a bigger script): #!/bin/bash cd /opt/oracle/bin ls -lt | tail -1 | awk '{print $6}' >> /tmp/ramb.out If I run this from the command prompt the result is: 2007-05-16 if I run it as a cron job then... (5 Replies)
Discussion started by: rajranibl
5 Replies

10. Shell Programming and Scripting

python vs bash - verbose mode

hey all! i'm looking how to render verbose python scripts. what i'm looking for would be an equivalent to a "bash -xf" in bash script headers.. Any help? (2 Replies)
Discussion started by: penguin-friend
2 Replies
Login or Register to Ask a Question