Sponsored Content
Top Forums Shell Programming and Scripting One directory, extracting only files to a new directoy Post 302954300 by 1in10 on Monday 7th of September 2015 05:01:26 PM
Old 09-07-2015
@Don Cragun
This is why I might cut the first 64 digits, because it looks a bit too nasty with the sha256sum, imagine sha512sum.

Code:
f888084c9ee5af98bb46df1c059b8cc2bcc4d9c43691e139f5bce44c64926e3a  ./drum/soundz4/GLASS CAVES – Out Of Control.mp3

as always learning

@Aia for heavens sake, sed coming up......yeah, I will train this....thanks, I will report later.

harsh.....

---------- Post updated 09-07-15 at 06:01 PM ---------- Previous update was 09-06-15 at 10:35 PM ----------

@Aia The quadcore works a lot with the xargs -0 version right now. I just started to read the first chapter of 63 for sed, so sorry, that this is one of the commands I hoped to avoid until now. First try results in one single file, the destination.mp3 in this case. hm....

@Don Cragun
one directory, 252 subdirectories, nearly 5000 tunes, different versions, kbps, length, put them in one folder.
My script from last year, well lets call it a snippet of a script, was hopping from one directory as the outset to move (cp) to destination. Then I took the destination to hop to the third new directory and so on. Surely not a hundred times, but it got a result of 30GB for snippets of tunes, one second of hihat, 3 seconds of openhihat, all together 26k files, or items. Therefore I used this construction

Code:
find /home/origin -type f -exec sha256sum {} \; | sort -k 64 >  /tmp/runner;txt | cp -nr /home/origin /home/destination && cat  -n /tmp/runner.txt | cut -d " " -f1; exit 0;

and guess what, it worked.

And I am aware, that the real 19 inch server rack is not sorted like this, they would put any file listed in alphabetical order, for each letter one drive, may even for different formats (.jpeg or .png) different mirrors. It is just to have it in one directory and later on on a pluggable drive.

@Aia It stopped after 575 songs, unable to call stat for "-" (no underliner), could not find directory. Running now version two, with sed. That goes well as root, I'll try it as well as user. Resulting in 4429 tunes, 22 GB. Orignally it was 22.9 GB. Now I could work with diff or midnight commander.

Last edited by 1in10; 09-07-2015 at 06:45 PM.. Reason: resulting in less
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Searching a directoy

Hi, How to search a directory and know it's path. Please Help. Thanks (3 Replies)
Discussion started by: gumsun
3 Replies

2. Shell Programming and Scripting

extracting a field from directory path ??????

Hi I'll be getting a directory path as the input to the script. E.g. 1 abc/fsg/sdfhgsa/fasgfsd/adfghad/XXX/fhsad e.g. 2 sadfg/sadgjhgds/sd/dtuc/cghcx/dtyue/dfghsdd/XXX/qytq This input will be stored in a variable. My query is how to extract the field in a variable VAR which occurs... (15 Replies)
Discussion started by: skyineyes
15 Replies

3. UNIX for Advanced & Expert Users

Extracting the different files from directory & its sub directories

Hi Everyone, It would be helpful if someone helps me on this. Requirement: I have a directory which includes different types of files(for example *.java,*.class),but not restricted for only these types. I need to find the same types of file extensions from its directories and subdirectories... (3 Replies)
Discussion started by: rcvasu
3 Replies

4. Shell Programming and Scripting

Extracting Directory From Path

Hi guys. I'm doing some bash scripting and have run into a snag. Say I have the path: /home/one/two/three/ All I need is the 'three' while making a filename. Is there an easy way to do this? I've tried using grep (because I'm that smart.) cut (as I'm unable to tell how many fields there... (3 Replies)
Discussion started by: Drayol
3 Replies

5. Shell Programming and Scripting

Zipping a directory and extracting to another server.

Hello everyone, I am trying to make a script in KSH that will zip an entire directory but leave out one file in that directory. I then need to send that zipped directory to another UNIX box. I am new to UNIX and would appreciate a good template to study from. (3 Replies)
Discussion started by: BrutalBryan
3 Replies

6. Shell Programming and Scripting

Extracting into a remote directory

I need to fit in a module in my Korn Shell script which would extract file_archive.tar.gz residing in the folder /apps/Test of my local machine into a folder /global/ in a remote machine server1. Please help me on this regard. Thanks Kumarjit. (2 Replies)
Discussion started by: kumarjt
2 Replies

7. Shell Programming and Scripting

Directoy Size - avoid cannot read directory

Hello, I need to write a script to check directory size on a linux server. I do not have access to some directories Inside the directory tree so I've got some warning in the output that say : du : cannot read directory .... Could you please help me. I did try Inside of my script to... (2 Replies)
Discussion started by: Aswex
2 Replies

8. Shell Programming and Scripting

How can we automaitcally sync/copy files from one directoy to another ?

Hi, I would like to achieve below requirement, I have a directory "/mydir" and I want to automatically sync/copy all the content of /mydir directory to "/yourdir" directory all the time. meaning, if some application creates a file in /mydir, it supposed to be copied/available in "/yourdir"... (4 Replies)
Discussion started by: aaron8667
4 Replies

9. UNIX for Beginners Questions & Answers

Extracting to another directory using cygwin

I have a file, in Windows, called php_0.27.tar.gz and want to extract it to C:\Program Files\PHP\script through Cygwin using this command: tar -xf php_0.27.tar.gz -C /Program Files/PHP/script But I got an error saying: tar: Files: Not found in archive I tried this command too: ... (8 Replies)
Discussion started by: steve120
8 Replies

10. UNIX for Beginners Questions & Answers

Extracting directory portion.

Dear Experts, I have some directory structure something like follows. I would like to cut portion of it. Would you please help me? I have to run this on several sql's. The directory path is dynamic. I have cut what comes after first "sql" string. Input:... (3 Replies)
Discussion started by: srikanth38
3 Replies
pyntor-selfrun(1)						      Pyntor							 pyntor-selfrun(1)

NAME
pyntor-selfrun - creation of self-extracting presentation archives SYNOPSIS
pyntor-selfrun [OPTIONS] presentation-archive|presentation-directory DESCRIPTION
Pyntor is a presentation tool which can display slides and effects of various formats. The tool pyntor-selfrun allows one to create self- extracting archives containing both the presentation and Pyntor itself, so that it can be run on computers where Pyntor itself is not installed. It also ensures independence of the corresponding Pyntor version, as future changes of the application do not affect the previ- ously created presentations. The way pyntor-selfrun works is that it takes the presentation-archive in question, packed as a tarball (which might be named *.pyntor), and the release tarball of Pyntor which must be present somewhere. Using a template file, it then creates the self-running and self-extracting script for distribution. In case the presentation-archive does not exist yet, pyntor-selfrun can create it automatically from a presentation-directory. This is use- ful even when not creating self-extracting archives, see the -a option. OPTIONS
-t, --template=templatefile Uses a template different from that one which is shipped with Pyntor and used by default. The template is a script in Python or another scripting language, which contains the variables %PYNTOR% and %ARCHIVE% which are replaced with the base64-encoded contents of the two files given as arguments to pyntor-selfrun. This option is not recommended for most cases. -a, --archive Creates a pyntor presentation-archive from a directory which contains a script file, local data files and optionally some local com- ponents. This is a convenience operation, since presentation archives are just tarballs, but in the future some checks might be done here. -r, --release=sourcetarball Specifies where to find Pyntor itself to include it into the self-extracting archive. The source tarball should be a released pyn- tor-*.tar.gz file. -h, --help Displays a summary of all available command line options. BUGS
In a future version, pyntor-selfrun should allow to create *.pyntor archives automatically by examining a script file, including only those files of Pyntor which it really needs. AUTHORS
Josef Spillner <josef@coolprojects.org> SEE ALSO
pyntor(1), pyntor-components(1) Cool Projects 0.6 pyntor-selfrun(1)
All times are GMT -4. The time now is 01:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy