Sponsored Content
Top Forums Shell Programming and Scripting Unexpected Argument list too long error on later os level Post 302989021 by say170 on Friday 6th of January 2017 10:42:33 AM
Old 01-06-2017
Unexpected Argument list too long error on later os level

I have a script on RedHat which runs this:

Code:
ssh -q -t -i $HOME/.ssh/my_key server2 "find ~/toCopy/*data* | xargs sudo mv -f -t /home/files/"

I'm getting:
Code:
sudo: unable to execute /bin/mv: Argument list too long

but the reason I use xargs is to avoid this restriction.

It used to work fine on :
Red Hat Enterprise Linux Server release 5.11 (Tikanga)
but fails on :
Red Hat Enterprise Linux Server release 6.8 (Santiago)

Any ideas, or is there a better command which overcomes this?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Argument list too long - Shell error

Trying to tar specific files from a directory causes problems when the number of files is too large. ls ~/logs | wc -l 5928 In the logs directory - I have 5928 files If I want to include all files with today's date - I run the following command tar cf ~/archive/LoadLogs_20060302.tar... (8 Replies)
Discussion started by: dad5119
8 Replies

2. Shell Programming and Scripting

TAR Files Argument list too long error

Hi, I have a requirement where I need to TAR more than 50K files. Even though I can do TAR successfully on few 100s of files, but whenever Im trying to TAR the entire 50K files, I am getting the error message : Argument List Too Long. Please suggest how can i avoid this error. Im... (2 Replies)
Discussion started by: unx100
2 Replies

3. Shell Programming and Scripting

"Argument list too long" error

Hi everyone, I have a problem with my shell script. As a quick overview I need to change a template file 6561 times and copy the file into a new catalogue. Thanks to your forum I have managed to write a script to do so: #!/bin/sh template=$1 for values in {45,165,285}\ {45,165,285}\... (6 Replies)
Discussion started by: mario8eren
6 Replies

4. Shell Programming and Scripting

Argument too long list error

I have a wrote a script which consits of the below line.. Below of this script I'm getting this error "ksh: /usr/bin/ls: arg list too long" The line is log_file_time=`ssh -i $HOME/.ssh/id_rsa -q $i ls -lrt /bp/karthik/test/data/log/$abc*|tail -1|awk '{print $8}'` And $abc alias is as "p |... (1 Reply)
Discussion started by: 22karthikreddy
1 Replies

5. Shell Programming and Scripting

Argument list too long problem

I have a huge set of files (with extension .common) in my directory around 2 million. When I run this script on my Linux with BASH, I get /bin/awk: Argument list too long awk -F'\t' ' NR == FNR { a=NR } NR != FNR { sub(".common", "", FILENAME) print a, FILENAME, $1 } '... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

6. Shell Programming and Scripting

Argument list too long!!

Dear Experts, I have a list of 10K files in a directory. I am not able to execute any commands lile ls -lrt, awk, sed, mv, etc........ I wanna execute below command and get the output. How can I achieve it?? Pls help. root# awk -F'|' '$1 == 1' file_20120710* | wc -l /bin/awk: Argument list... (2 Replies)
Discussion started by: Naga06
2 Replies

7. Shell Programming and Scripting

grep : Argument list too long

Hi, i am having some trouble with the below command, can some one suggest me the better way to do it. grep -l 'ReturnCode=1' `find $Log -newer /tmp/Failed.tmp -print | xargs ls -ld | egrep SUB | egrep -ve 'MTP' -ve 'ABC' -ve 'DEF' -ve 'JKL' -ve 'XYZ' | awk '{print $9}'` > $Home1 Its... (2 Replies)
Discussion started by: Prateek007
2 Replies

8. Shell Programming and Scripting

mv : Argument list too long

Hi I am using find command -- find "directory1" -type f | xargs -i mv {} "directory2" to avoid above argument list too long problem. But, issue i am facing is directory1 is having subdirectories due to this i am facing directory traversal problem as i dont want to traverse subdirectories... (9 Replies)
Discussion started by: VSom007
9 Replies

9. UNIX for Advanced & Expert Users

Argument list too long w/ sed

Hi all, I am using GNU sed (named gsed under macports) in OSX. I have a directory with a series of files named pool_01.jpg through pool_78802.jpg. I am trying to use this command to rename the files to their checksum + extension. md5sum * | gsed -e 's/\(*\) \(.*\(\..*\)\)$/mv -v \2 \1\3/e' ... (3 Replies)
Discussion started by: openthomas
3 Replies

10. Shell Programming and Scripting

Argument list too long

Hi Team, Here's the situation. I have approximately 300000 to 500000 jpg files in /appl/abcd/work_dir mv /appl/abcd/work_dir /appl/abcd/process_dir The above move command will work if the jpg files count is close to 50000 (not sure). If the count is less this mv command holds good. But if... (14 Replies)
Discussion started by: kmanivan82
14 Replies
UP2DATE(8)							   Red Hat, Inc.							UP2DATE(8)

NAME
rhnsd - a program for quering the Red Hat Network for updates and information SYNOPSIS
rhnsd [OPTION]... DESCRIPTION
rhnsd is a daemon process that runs in the background and periodically polls the Red Hat Network to see if there are any queued actions available. If any are queued, it runs them. rhnsd is typically started from the init scripts in /etc/init.d/rhnsd when it's time to poll the Red Hat Network servers for available updates and actions. The default interval is every 120 minutes. The minimum polling interval is 60 minutes. To check for updates, rhnsd runs an external program called rhn_check. This is a small application that actually makes the network connec- tion to Red Hat Networks. The rhnsd daemon does not listen on any network ports, nor does it ever talk to the network directly. Any network activity is done via the rhn_check utility. rhnsd can be configure by editing the /etc/sysconfig/rhn/rhnsd config file. This is actually the configuration file the rhnsd init script /etc/init.d/rhnsd uses. -i, --interval Specify the interval that rhnsd should wait between checking the Red Hat Network. Default is 120 minutes, the minimum is 60 minutes. This can also be specified in /etc/sysconfig/rhn/rhnsd -v, --verbose output more information about what rhnsd is doing. -f, --foreground force the rhnds process to run in the foreground instead of automatically backgrounding itself, as it does by default. FILES /etc/sysconfig/rhn/rhnsd Configuration settings for the rhnsd daemons init script. /usr/sbin/rhn_check The external program launched by rhnsd to connect to the Red Hat Network and retrieve any actions that have queued up. /etc/sysconfig/rhn/systemid A certification that authenticates the client machine to the Red Hat Network. Generated via the up2date or rhnreg_ks utility. SEE ALSO
The rhnsd daemon is tightly coupled with Red Hat Network. Visit <http://www.redhat.com/network> for access or to sign up. rhn_check(8), up2date(8), up2date-config(8), AUTHORS
Written by Preston Brown <pbrown@redhat.com> and Cristian Gafton <gafton@redhat.com> REPORTING BUGS
Report bugs to <http://bugzilla.redhat.com>. COPYRIGHT
Copyright (C) 1999, 2000 Red Hat, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. 4th Berkeley Distribution Fri Feb 9 2001 UP2DATE(8)
All times are GMT -4. The time now is 09:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy