11-20-2009
How to Pull out multiple files from DB table and redirect all those files to a differetn directory?
Hi everyone!!
I have a database table, which has file_name as one of its fields.
Example:
File_ID File_Name Directory Size
0001 UNO_1232 /apps/opt 234
0002 UNO_1234 /apps/opt 788
0003 UNO_1235 /apps/opt 897
0004 UNO_1236 /apps/opt 568
I have to extract all the files whose size is greater than 500 and send all those files to a different directory /apps/opt/new
How do I loop through the table and send all those file_names, which match the size criteria to a different directory?
Thanks in advance..
Please do help me out, as this is very urgent for me.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I am new to shell scripting and have a question. I would like to redirect the output of a command to multiple files, each file holding the exact same copy. From what I read from the bash manpage and from some searching it seems it cannot be done within the shell except setting up a loop. Is... (3 Replies)
Discussion started by: cbkihong
3 Replies
2. UNIX for Dummies Questions & Answers
I have a program that is reading strings into a vector from a file. Currently I am using this command:
a.out < file1
The program runs and prints the contents of the vector to the screen, like its supposed to. The problem is that it needs to read in 3 files to fill the vector. Is there anyway... (4 Replies)
Discussion started by: Matrix_Prime
4 Replies
3. Shell Programming and Scripting
i have some 2000 files and i want to redirect it to a dir
after i give the command
find . -mtime -15 -print
it gives some 2000 files
file1.DAT
file2.DAT
:
:
:
file2000.DAT
------------------------------------------------------------------------how to redirect all these 2000 files... (2 Replies)
Discussion started by: ali560045
2 Replies
4. Shell Programming and Scripting
How to redirect the output to multiple files without putting on console
I tried tee but it writes to STDOUT , which I do not want.
Test.sh
------------------
#!/bin/ksh
echo "Hello " tee -a file1 file2
----------------------------
$>./Test.sh
$>
Expected output:
-------------------... (2 Replies)
Discussion started by: prashant43
2 Replies
5. Shell Programming and Scripting
I have a program that runs like "cat f1 - f2 -", I need to write shell script to run the program whose standard input will be redirected from 2 files. I spend a whole day on it, but didn't figure out. Can someone help me out? Thanks! (8 Replies)
Discussion started by: microstarwwx
8 Replies
6. UNIX for Dummies Questions & Answers
Hi,
i know how to
a) redirect stdout and stderr to one file,
b) and write to two files concurrently with same output using tee command
Now, i want to do both the above together.
I have a script and it should write both stdout and stderr in one file and also write the same content to... (8 Replies)
Discussion started by: ysrini
8 Replies
7. Shell Programming and Scripting
Hi,
I am new to script and I want find one string from multiple files in diff directories and put that out put to new file.
Like I have A,B & C directories and each has multiple files but one file is unic in all the directories like COMM.txt
Now I want write script to find the string... (8 Replies)
Discussion started by: Mahessh123
8 Replies
8. UNIX for Dummies Questions & Answers
Hi ,
I have searched through the forum but not able to find out any help :(
i have a directory having lot of files which contains sql statemtns
eg : file 1 contains
select from table_name1 where .....................
select from
table_name2 where ..........
select
from ... (3 Replies)
Discussion started by: Trendz
3 Replies
9. Shell Programming and Scripting
Hi Everyone,
Im currently using the below code to pull data from a large CSV file and put it into smaller files with just the data associated with the number that I "grep".
grep 'M053' test.csv > test053.csv
Is there a way that I can use grep to run through my file like the example below... (6 Replies)
Discussion started by: TheStruggle
6 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I need to load data from two files to a single table.
My requirement is that I get two files in which a few column data are manadatory.
These files are identified based on the file name.
For example, I have two files ABCFile and BCDFile. ABCFile has mandatory data in column 3 and 4... (0 Replies)
Discussion started by: reshma15193
0 Replies
LEARN ABOUT MOJAVE
safeejectgpu
SafeEjectGPU(8) BSD System Manager's Manual SafeEjectGPU(8)
NAME
SafeEjectGPU -- Facilitate safe eject/disconnect of eGPU(s) from system
SYNOPSIS
SafeEjectGPU [gpuid <gpuid>] [gpus] [apps] [status] [Eject] [Initiate] [Relaunch] [Finalize] [Cancel] [RelaunchPID <PID>] ...
DESCRIPTION
The SafeEjectGPU command is used to prepare for safe eject/disconnect of eGPUs from the system. This involves interacting with apps to
migrate off of ejecting eGPU(s), and triggering the eject itself. This tool can also be used to view what GPUs are attached to the system,
their eject status, and what apps hold references to each.
A list of commands and their descriptions - note that commands affecting state are capitalized, and that multiple (including repeated) com-
mands can occupy the same command line:
gpus Lists attributes of GPUs currently attached to system (gpuid, vendor/model, flags)
gpuid <gpuid> Specifies which GPU(s) subsequent commands apply to. The default (0x0000) means all eGPUs. See output of gpus command
for valid <gpuid> values (of the form 0x7005) to use.
apps Lists apps holding references to specified GPU - and app attributes/properties like PID, RPID, USER, PROCESS, APIS (Metal,
GL/CL, GVA), BUNDLE_IDENTIFIER, PATH, GPUEjectPolicy and GPUSelectionPolicy where specified.
status Shows eject state of specified eGPU(s) (Present, Initiated, Finalized).
Eject Performs the full Eject sequence ( Initiate + Relaunch + Finalize ) of specified GPU(s).
Initiate Initiates eject of specified eGPU(s). These eGPUs are temporarily hidden from API instantiations.
Relaunch Interacts with apps that hold references to specified eGPU(s) - to facilitate migration to remaining GPUs.
Finalize Finalizes eject of specified eGPU(s) - must be physically unplugged before they can be used again.
Cancel Cancels initiated eject of specified GPU(s) - instead of Finalized.
RelaunchPID <PID> Apply relaunch stimulus to one particular PID - for app relaunch stimulus testing.
EXAMPLES
$ SafeEjectGPU gpus
List eGPUs. Output is useful for cut-n-paste of example specified gpuid values used below $ SafeEjectGPU gpus apps status
List all eGPUs and Apps on all eGPUs along with eject status of all eGPUs
$ SafeEjectGPU Eject
Perform full Eject sequence on all eGPUs
$ SafeEjectGPU gpuid 0x7005 Eject
Perform full Eject sequence on specified eGPU
$ SafeEjectGPU gpus apps gpuid 0x7153 apps
Lists all eGPUs and apps on all eGPUs and on integrated GPU as well
$ SafeEjectGPU Initiate RelaunchPID 12345 Cancel
Hide eGPUs and send relaunch stimulus to PID without doing full eject
PLIST PROPERTIES
The following properties are generally inferred. Some values can be specified in the app's Info.plist. They affect eGPU eject and API
selection behaviors. Generally, these properties won't need to be specified:
GPUEjectPolicy
Inferred/Settable GPUEjectPolicy values for dealing with apps that needs to drop references to ejecting eGPU. Establisehd in app
bundle's Info.plist. Possible values:
relaunch Send AppKit quit-with-save event followed by open-with-restore (relaunch app using alternate GPU(s)).
wait Just wait for GPU references to drop (without sending events or signals).
kill Use sigKill to force app exit (for apps that will relaunch via launchd - using alternate GPU(s)).
ignore Ignore - necessary for some internal GPU/display components - working to eliminate its use.
Inferred-Only GPUEjectPolicy values (you can't specify these values, but you'll see them as defaulted/inferred policies in apps out-
put):
wrelaunch Wait momentarily for processing of Metal GPU change notifications before resorting to relaunch
(as necessary).
jrelaunch Just relaunch
without waiting (since OpenGL/OpenCL are in use).
rwait When a process is subordinate to another, "responsible", process (see RPID column), Eject actions apply to the responsible
process, who in turn deals with subordinates to eliminate their ejecting eGPU references.
GPUSelectionPolicy
Settable values that affect instantiation of Metal and OpenGL/CL contexts (wrt eGPU use). Established in app bundle's Info.plist.
Possible values:
avoidRemovable Avoid creation of MTLCommandQueues, and OpenGL/CL contexts on eGPUs.
preferRemovable Prefer creation of MTLCommandQueues, and OpenGL/CL contexts on eGPUs.
SEE ALSO
plist(5) sudo(8) launchd(8)
HISTORY
The command line SafeEjectGPU tool first appeared in the 10.13.4 release of Mac OS X.
Mac OS X January 22, 2018 Mac OS X