I'm running debian (the raspbian version of it) and working on a script to compare files in 2 directories, source and target, move files with duplicate names to a 3rd directory, then move remaining files in source to target. I can't get the syntax right, keep getting syntax errors and can't get past the file comparison stage to start figuring out the move portion. I thought I'd print the results to start, to see if it's working.
This isn't intended to be a command line script, it's intended to run automatically on boot so there shouldn't be any user intervention required. I found several scripts that require a user to input directories when they're run, then delete duplicates. I took what looked like the most easy to understand one and am trying to modify it. I was mistaken about the simplicity.
Greetings -
I am a newbie in shell scripts. I have been thru the whole forum but there has been no similar query posed.
The objective of my system is to have a unified filebase system. I am using RSync to synchronise files between the location & central server with both of them having the... (4 Replies)
I would like to know how to compare a listing of directories that begin with the same four numbers ie.
/1234cat
/1234tree
/1234fish
and move all these directories into one directory
Thanks in advance (2 Replies)
ok i asked around to a few ppl and they said to use sed or awk to do what i want.. but i cant figure out how to use it like that..
anyway i have a text file that is 10k lines long.. i need to move text from the end of a line after the ? and move it to the front of the line then add a | after it.... (3 Replies)
I'm rather new to scripting, and despite my attempts at finding/writing a script to do what I need, I have not yet been successful.
I have a file named "list.txt" of arbitrary length with contents in the following format:
/home/user/Music/file1.mp3
/home/user/Music/file2.mp3... (21 Replies)
My input file is multiline file and I am writing a script to search for a pattern and move the line with the pattern and the next line to the end of the file. Since I am trying to learn awk, I thought I would try it.
My input looks like the following:
D #testpoint 1
510.0
D #testpoint2 ... (5 Replies)
Hello all.
I am new to this forum (and somewhat new to UNIX / LINUX - I started using ubuntu 1 year ago).:b:
I have the following problem that I have not been able to figure out how to take care of and I was wondering if anyone could help me out.:confused:
I have all of my music stored in... (7 Replies)
Hi there,
I am having trouble with a script I have written, which is designed to search through a directory for a header and payload file, retrieve a string from both filenames, compare this string and if it matches make a backup of the two files then move them to a different directory for... (1 Reply)
Hi,
Anybody help me to write a Shell Script
Get the latest file from the file list based on created and then move to the target directory.
Tried with the following script: got error.
A=$(ls -1dt $(find "cveit/local_ftp/reflash-parts" -type f -daystart -mtime -$dateoffset) | head... (2 Replies)
Hi
In directory /mnt/upload I have about 100 000 files (*.png) that have been created during the last six months. Now I need to move them to right folders. eg:
file created on 2014-10-10 move to directory /mnt/upload/20141010
file created on 2014-11-11 move to directory /mnt/upload/20141111... (6 Replies)
Shell script logic
Hi
I have 2 input files like with file 1 content as (file1)
"BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt
File 2 contents as fle(2)
"BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt
I want to get... (22 Replies)
Discussion started by: pottic
22 Replies
LEARN ABOUT DEBIAN
afs-up
AFS-UP(1) AFS Command Reference AFS-UP(1)NAME
up - Recursively copy directories, preserving AFS metadata
SYNOPSIS
up [-v] [-1] [-f] [-r] [-x] [-m]
<source directory> <destination directory>
DESCRIPTION
The up command recursively copies the files and subdirectories in a specified source directory to a specified destination directory. The
command interpreter changes the destination directory and the files and subdirectories in it in the following ways:
o It copies the source directory's access control list (ACL) to the destination directory and its subdirectories, overwriting any
existing ACLs.
o If the issuer is logged on as the local superuser root and has AFS tokens as a member of the group system:administrators, then the
source directory's owner (as reported by the "ls -ld" command) becomes the owner of the destination directory and all files and
subdirectories in it. Otherwise, the issuer's user name is recorded as the owner.
o If a file or directory exists in both the source and destination directories, the source version overwrites the destination version.
The overwrite operation fails if the first (user) "w" (write) mode bit is turned off on the version in the destination directory,
unless the -f flag is provided.
o The modification timestamp on a file (as displayed by the "ls -l" command) in the source directory overwrites the timestamp on a file
of the same name in the destination directory, but the timestamp on an existing subdirectory in the destination directory remains
unchanged. If the command creates a new subdirectory in the destination directory, the new subdirectory's timestamp is set to the time
of the copy operation, rather than to the timestamp that the subdirectory has in the source directory.
The up command is idempotent, meaning that if its execution is interrupted by a network, server machine, or process outage, then a
subsequent reissue of the same command continues from the interruption point, rather than starting over at the beginning. This saves time
and reduces network traffic in comparison to the UNIX commands that provide similar functionality.
The up command returns a status code of 0 (zero) only if it succeeds. Otherwise, it returns a status code of 1 (one).
This command does not use the syntax conventions of the AFS command suites. Provide the command name and all option names in full.
OPTIONS -v Prints a detailed trace to the standard output stream as the command runs.
-1 Copies only the files in the top level source directory to the destination directory, rather than copying recursively through
subdirectories. The source directory's ACL still overwrites the destination directory's. (This is the number one, not the letter "l".)
-f Overwrites existing directories, subdirectories, and files even if the first (user) "w" (write) mode bit is turned off on the version
in the destination directory.
-m Recognize and copy mount points rather than traversing the volumes they reference during the recursive copy operation. Without -m,
up's default behavior is to copy the contents of all volumes and subvolumes mounted under the source directory into the volume
containing the destination directory.
-r Creates a backup copy of all files overwritten in the destination directory and its subdirectories, by adding a ".old" extension to
each filename.
-x Sets the modification timestamp on each file to the time of the copying operation.
source directory
Names the directory to copy recursively.
destination directory
Names the directory to which to copy. It does not have to exist already.
EXAMPLES
The following command copies the contents of the directory dir1 to directory dir2:
% up dir1 dir2
PRIVILEGE REQUIRED
The issuer must have the "a" (administer) permission on the ACL of both the source and destination directories.
COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas
Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.
OpenAFS 2012-03-26 AFS-UP(1)