10-23-2012
move script
hi guys i have a simple question
i have a directory with name of files in /tmp which contain some files
i want to check all files with file command and if they were MP3 or Wave sync them into new place . for example ( /root/mp3 )
i find all files and remove white space and rename them
next i check them with file command and if they were mp3 or wave we should sync or copy them with exact path into new place
eg.
/tmp/files/test1 ------> /root/mp3/test1
/tmp/files/New/test2 ----------> /root/mp3/New/test2
/tmp/files/New/last/Old/test-old ------------> /root/mp3/New/last/Old/test-old
files should copy into same directory in new the place
what can i do ?
i think to
echo $new |sed "s#/tmp/files#/root/mp3"
but it doesnt work
what can i do ??
PHP Code:
#!/bin/bash
old=/tmp/files
new=/root/mp3
find /tmp/files3 -name *.* | while read FILE
do
new=$(echo $FILE | sed 's/ /_/g')
mv "$FILE" $new
file "$new" |egrep -w 'MP3|WAVE'
if [ $? = 0 ]
then
cp .................
fi
done
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello Gurus!
Please help!
I would like to get some help with the following:
I'm working right now on a Data Warehouse project and I need to automate a manual procedure I am using to process the data files coming into the database, any information/ideas and or which script language to go... (4 Replies)
Discussion started by: alfpathros
4 Replies
2. Shell Programming and Scripting
Does anyone have a good script to move log files from a cron?
There are a lot of logs, about 100 or more and they are constantly
being written too. (7 Replies)
Discussion started by: photon
7 Replies
3. Shell Programming and Scripting
Hi,
Want to write a script which move like:
these are files in different dir structure,
/home/darshak/test/sh/new.txt
/home/darshak/test/new1.txt
/home/darshak/test/pl/file.txt
script will move same structure as above but in different dir,
/usr/local/test/sh/new.txt... (2 Replies)
Discussion started by: darshakraut
2 Replies
4. UNIX for Dummies Questions & Answers
Hi
I am very new to scripts and only have a basic knowledge
What i am trying to do is move files from one directory to another, but i need to make sure the file is stable before it moves the file to the destination. Here is the script that i am using that is moving the files, it part of a script... (8 Replies)
Discussion started by: treds
8 Replies
5. UNIX for Dummies Questions & Answers
Anyone have an idea to why the statement below does not work within a script but works when issued from the command line?
mv /dir_files/submit.log* /bintemp (1 Reply)
Discussion started by: bwcberb
1 Replies
6. UNIX Desktop Questions & Answers
Hi
I am after a simple script to move folders/files from one directory into another directory on the same server. I want to run a cron so this can run at midnight.
Issue is there will not always be data in the source folder.
This script works fine but it errors if nothing exists in the source... (3 Replies)
Discussion started by: treds
3 Replies
7. Shell Programming and Scripting
hi,
I have a lot of files named xxxxx__AA.txt, xxxxx__BB.txt, xxxxx__CC.txt and I would like to move xxxxx__AA.txt in AA directory, xxxxx__BB.txt in BB etc. Could you help me do it in bash script? (5 Replies)
Discussion started by: corfuitl
5 Replies
8. Shell Programming and Scripting
Hi All,
I am new to Linux/Scripting and need some assistance in coming up with a script that can move certain amount of files from one directory to other every seconds.
Usercase: We have around 100k files in tmp directory on my server which needs to be moved to another folder to get... (3 Replies)
Discussion started by: Raj1184
3 Replies
BURN(1) Burn BURN(1)
NAME
burn - record from various sources to optical media (CD, DVD)
SYNOPSIS
burn MAIN_MODE [OPTIONS]... [FILE/S]...
burn --help
DESCRIPTION
CD-writing program/script. Features Data-CD, Audio-CD, Copy on the fly, Iso-CD.
CONFIGURATION
Configuration files for burn are: ~/.burnrc or /etc/burn.conf. You can edit them to change values.
If you don't have these files you can:
1. use burn-configure utility
2. take the configuration template, edit and copy it as ~/.burnrc or /etc/burn.conf
MAIN MODES
-D, --data-cd
To create Data-CD
-I, --iso-cd
To create ISO-CD
-C, --copy-cd
To copy CDs
-A, --audio-cd
To create an audio CD from WAV, MP3 and ogg files
EXAMPLES
# burn -D -p /etc/
Creates a CD with /etc/ contents. (you will find files and directories contained in /etc in CD's root.)
# burn -D -p /home/bigpaul/video/summer_2003/spain.tar.gz
Creates a CD with spain.tar.gz in CD's root
# burn -D -r /etc/
Creates a CD containing the whole /etc/ directory. (-r preserves path)
# burn -D -c /mail_2003 /home/bigpaul/Mail -p /boot/vmli*
Creates a CD containing the whole /home/bigpaul/Mail renamed into /mail_2003. (-c changes path name). This command also adds in CD's root
every vmli* file in /boot/ directory
# burn -I -n image.iso
Burns image.iso
# burn -C
Copy CDs (disk at once).
# burn -A -a *.wav
Creates an Audio CD. Tracks come from wav files
# burn -A -a *.mp3
Creates an Audio CD. Tracks come from mp3 files
# burn -A -a *.ogg
Creates an Audio CD. Tracks come from Ogg Vorbis files
# burn -A -a *.mp3 file.ogg track01.wav
Creates an Audio CD preserving input order. In this example the first audio tracks will come from mp3 files, than we will find the one from
file.ogg and finally the one from track01.wav
GENERAL OPTIONS
-s, --simulate
to perform a burn simulation
DATA-CD OPTIONS
-p, --path
add file/s or path's content to CD-ROM's root. e.g.: -p /cvs/myproj/. In this example we will find CD-ROM's root filled with
/cvs/myproj/ contents, but no /cvs/myproj/ will be created
-r, --preserve-path
add file/s or path's content to CD-ROM preserving original path. e.g.: -r /cvs/myproj/. In this example we will find /cvs/myproj/
in CD-ROM's root
-x, --exclude-path
every file or directory matching this string will not be included
-c, --change-path
old_path will be named new_path in CD-ROM. e.g.: -c /my_home/2004_Jan/ /home/bigpaul/. Thus /home/bigpaul/ will be named
/my_home/2004_Jan/ in CD-ROM.
-l, --follow-symlink
this option allows burn to follow symbolic link directories
-m, --multisession
this option allows multisession CDs
ISO-CD OPTIONS
-n, --name
image name
AUDIO-CD OPTIONS
-a, --audio-file
mp3, ogg or wav file/s
AUTHOR
Ben Finney <ben+python@benfinney.id.au>, Gaetano Paolone <bigpaul@hacknight.org>
COPYRIGHT
This is free software: you may copy, modify, and/or distribute this work under the terms of the GNU General Public License, version 2 or
later as published by the Free Software Foundation. No warranty expressed or implied. See the source for details.
2009-07-22 BURN(1)