05-31-2015
I apologize. I assumed that you had read through the thread that you copied my code from:
Moving files from parent path to multiple child path using bash in efficient way and that you were trying to do something similar, but copying CSV files instead of TXT files. What that thread was doing was to move files from one place in a file hierarchy up one level (removing one intermediate directory in the source path) to another set of pre-existing directories in that same source file hierarchy.
With your latest set of changes to my script, you are apparently trying to move files from
/home/user/pumela to
/home/user/pumela/home/user/pumela and, since
/home/user/pumela/home/user/pumela is not an existing directory, the script exits because there is nothing to do. And, whereas in post #1 in this thread
/home/user/pumela/archive was a target directory; in this latest set of changes to the script, it is some kind of regular file that stores the output produced by the most recently run
cd command???
So, let's go back to step 1! Please forget about the script that you copied and tell us exactly what you are trying to do:
- What directory or directories contain files that you want to move?
- To what directory or directories do you want to move those files?
- Are the files you want to move on the same system as the directory or directories to which you want to move them?
- Is or are the target directory or directories on the same filesystem as the directory or directories that contain the files your want to move?
- Is cygwin (running under some version of Windows) the only system on which you want to run this script? If not, what other systems will you be using to run this script?
PS The title of this thread is "
Issues in Csv file transfer copy from one dir to another". "Move" and "transfer copy" are two different things. Do you want to
move files or do you want to
copy files?
Last edited by Don Cragun; 05-31-2015 at 08:44 PM..
Reason: Add PS.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I wanted to know how i can copy a file to a directory and then verify if that file is completely copied or not?
Now the issues here is that the dir and the source file are to be sent as arguments to a function( this function should actually copy the files to a dir, then check if its... (0 Replies)
Discussion started by: wrapster
0 Replies
2. UNIX and Linux Applications
HI all, I got a CPIO archive that contains a unix filesystem that I try to extract, but it extract to the root dir / unstead of current dir, and happily it detects my file are newer otherwise it would have overwrited my system's file!
I tried all these commands
cpio -i --make-directories <... (2 Replies)
Discussion started by: nekkro-kvlt
2 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I'm puzzled at how this could be.
I'm trying to transfer some files from an Sun box to an AIX box via FTP. The file transfer goes fine until it reaches a file of about 150k then times out and fails.
The FTP Does not seem to be able to transfer files of more than 150k! However, I can... (5 Replies)
Discussion started by: bbbngowc
5 Replies
4. UNIX for Dummies Questions & Answers
Hello all.
I'm not getting the hang of Paths. I have a dir w/files that I want to copy to another dir. Right now I am in the "source" directory. I want to copy it to Ch7.
"cp -r source Ch7". Ch7 was already created.
1st msg.: cannot stat `source`: No such file or dir.
I typed pwd & got... (3 Replies)
Discussion started by: Ccccc
3 Replies
5. Shell Programming and Scripting
Hi everyone. I am trying to write a bash script that will copy files from one directory to another but I need to be able to check the directory that I'm copying the files to and see if the file already exists. If it does I need to add a number at the end of the copied file. Thanks for your help. (3 Replies)
Discussion started by: snag49ers
3 Replies
6. Shell Programming and Scripting
hi,
I want to copy files from source directory based on input file (or output of previous command) and i want to have the SAME DIRECTORY STRUCTURE.
Note that i will have other files and directories which i dont want to copy to destination.
For example, dir source has following content:... (22 Replies)
Discussion started by: dragon.1431
22 Replies
7. Shell Programming and Scripting
my user copy large files, and it's take 10min for file to be copied to the server (/tmp/user/ files/), if in the meantime start my scheduled script, then it will copy a part of some file to server1
my idea is to check the file size twice in a short period (1-2 seconds) of time, then compare, if... (5 Replies)
Discussion started by: waso
5 Replies
8. Shell Programming and Scripting
Hello Comunity
I am trying to make a bash shell script that it copies files and subdirs(with files) to a new dir. I would like the dest_dir to contain only subdirectories with files not other subdirs inside.
it called : cpflatdir src_dir dest_dir
Pleaze help me!
Thank you in... (2 Replies)
Discussion started by: BTKBaaMMM
2 Replies
9. UNIX for Advanced & Expert Users
Using RCP command we can transfer file from one server to another server.
While transferring we can rename the file also e.g.
File name = FILE123.txt (lying on Source server = oldserver)
Target Server Name = newyour
Renamed File = FILE456.txt
rcp FILE123.txt newyour:./FILE456.txt... (1 Reply)
Discussion started by: Pash
1 Replies
10. Shell Programming and Scripting
I was trying to copy the files inside the path /home/user/check/Q1/dir/folder1/expected/n/a1.out1 and a1.out2 and a1.out3 to /home/user/check/Q2/dir/folder1/expected/n/
if n directory is not present at Q2/dir/folder1/expected/ then directory should be created first. And, script follow the... (5 Replies)
Discussion started by: Mannu2525
5 Replies
LEARN ABOUT DEBIAN
unburden-home-dir
UNBURDEN-HOME-DIR(1) User Commands UNBURDEN-HOME-DIR(1)
NAME
unburden-home-dir - unburdens home directories from caches and trashes
SYNOPSIS
unburden-home-dir [ -n | -u | -f filter ]
unburden-home-dir ( -h | --help | --version )
DESCRIPTION
unburden-home-dir unburdens the home directory from files and directory which cause high I/O or disk usage but are neither important if
they are lost, e.g. caches or trash directory.
When being run it moves the files and directories given in the configuration file to a location outside the home directory, e.g. /tmp or
/scratch, and puts appropriate symbolic links in the home directory instead.
OPTIONS
-f just unburden those directory matched by the given filter (a perl regular expression) -- matches the already unburdened directories
if used together with -u.
-F Do not check for files in use with lsof before (re)moving files.
-n dry run (show what would be done)
-u undo (reverse the functionality and put stuff back into the home directory)
-h, --help
show this help
--version
show the program's version
EXAMPLES
Example configuration files can be found at /usr/share/doc/unburden-home-dir/examples on Debian-based systems and in the etc/ directory of
the source tar ball.
FILES
/etc/unburden-home-dir, /etc/unburden-home-dir.list, ~/.unburden-home-dir, ~/.unburden-home-dir.list, /etc/default/unburden-home-dir,
/etc/X11/Xsession.d/95unburden-home-dir
Read /usr/share/doc/unburden-home-dir/README on debianoid installations or README in the source tar ball for an explanation of these files.
SEE ALSO
corekeeper (http://openvswitch.org/cgi-bin/gitweb.cgi?p=corekeeper), autotrash(1), agedu(1), bleachbit(1).
For du(1)-like but more comfortable tools, see ncdu(1) (text-mode), baobab(1) (GNOME), filelight(1) (KDE), xdiskusage(1) (X tool calling
du(1) itself), or xdu(1) (X tool reading du(1) output from STDIN).
AUTHOR
Unburden Home Dir is written and maintained by Axel Beckert <beckert@phys.ethz.ch>
LICENSE
Unburden Home Dir is available under the terms of the GNU General Public License (GPL) version 2 or any later version at your option.
Unburden Home Directory May 2012 UNBURDEN-HOME-DIR(1)