File copy from shell using nautilus file operations?
Is it possible to have the nautilus file operations copy command from a shell? In other words, rather than using the cp command, I'd like to have a file copy triggered from a bash script that uses the familiar "File Operations" dialog box in nautilus. Can this be done?
Hello Bibin,
Give this a try., if i understood correctly. I coudn't test it my side.
$servers = get-content C:\hosts.txt
foreach ($server in $servers)
if(test-path \\Centralserver\share\$server)
if(test-path \\$server\c$\xxx.file)
Copy -path \\$server\c$\xxx.file -Destination \\CentralServer\share\$server\ -Recurse -ErrorVariable CopyErrorS
#stores all your copy errors
$copyError = $copyError + $copyerrorS
else
Write-Output "source file on server $server is missing"
else
New-Item -Name $server -ItemType Directory -path \\centralserver\share\ -Force -Errorvariabe FCreationErrorS
#Stores all your Folder creation errors
$FCreationError = $FCreationError + $FCreationErrorS
if((test-path \\$server\c$\xxx.file) -and (test-path \\Centralserver\share\$server))
Copy -path \\$server\c$\xxx.file -Destination \\CentralServer\share\$server\ -Recurse -force
else
Write-Output "Error creating source folder on $server."
Regards,
V.
Venu
Similar Messages
-
How can I read something from keyboard using i/o operations?
I wrote the following code in java using *"oracle Jdeveloper 11g release 2"* platform and i think it's correct, but I have a little problem when I try to execute him, it asks me to introduce a number, and this it's correct, but I don't know how to introduce that number. If i want to write the same code in c or c++ using Visual Studio it's very easy when i want to introduce a number i must run the code and then a console window will appear and then i introduce the number.
Could someone to give me a link at a tutorial about how to use *"oracle Jdeveloper 11g release 2"* when I have to use i/o operations or something useful.
package instante;
import java.io.*;
public class Read_from_keyboard {
public static void main(String[] args) {
BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in), 1);
double number_read = 0.0;
String line = "";
try {
System.out.flush();
System.out.println("Give a number: ");
line = keyboard.readLine();
Double tmpDouble = Double.valueOf(line);
number_read = tmpDouble.doubleValue();
System.out.println("The number is: " + number_read);
} catch (IOException e) {
System.out.println(" Input from keyboard " + e.toString());
System.exit(1);
Thank you!
Edited by: Iosif on Nov 9, 2012 5:06 AMIts a command line application. Perhaps JDeveloper has support built in to be able to do that in the IDE, but generally you'd just want to run a command line application on the command line / shell. How to do that is described in any Java book, in the Oracle Java tutorials and in just about a couple hundred/thousand articles you can find through Google.
Other than that, the JDeveloper forum is here:
JDeveloper and ADF -
How to copy file to another server from database using FTP in oracle
How to copy file to another server from database using FTP in oracle.
Please do the needfaul.Billy Verreynne wrote:
BluShadow wrote:
Not to mention that some FTP servers can return more than one return message per operation whereas others may return one message for the same operation.I had the problem using the LIST command to determine if a file exists on the server. Cannot be determined via the FTP server's return code. Which means parsing and checking the text response from the server to the command. And this vary from server to server.
But the basics were quite easy to code. The entire package is 500 lines, includes comments and blank lines for formatting, and supports the basic FTP client command set. Not really a complex piece of software to write - but I found that many developers seem to think that writing network socket software is complex. Not really the case...Mine's a big larger, but incorporates functionality similar to what Chris provided in his, such as being able to use SQL to query a remote file using pipelined functions, or functionality to write the results of a query directly to a remove file.
:) -
Dear ladies and gentlemen!
I recently received on my notebook, operating system 8.1, the message "Adobe Acrobat is no longer working properly". I also found myself that I can copy from einerPDF file excerpts not without problems in another document. My Adobe Acrobat 9 Pro has released version 9.0.0. Two updates this version is not listed. Please inform me how I can fix this problem.
Sincerely, Walter Hacksteiner
mailto: [email protected]The first thing I would try is to update Acrobat 9 to the latest version 9.5.5
The next thing would be to run Acrobat 9 in Windows 7 or Vista or XP Compatibility Mode. -
Operation could not be completed because "whatever file i'm copying" is in use
Ever since upgrading my 2012 Mac Air to Mavericks, I've been seeing this error message sporadically when copying files to my SMB share on my raspberrypi.
I'm not sure if it's just coincidence with the os upgrade, and I'm not sure how to consistently reproduce the problem.
"Operation could not be completed because "whatever file I'm copying" is in use".
It doesn't seem to matter if I'm copying one file or a bunch of files. Randomly, that message will pop up, and then the copy will stop.I've restarted the mac quite a few times, with and without the reopen option checked. Made sure the first thing to do was to copy those files to the other server. The only thing that could be using the files, would be Finder itself. It seems like when I have a list of files to copy, the message will pop up somewhere in the middle of the list. All the files previous to the error have been copied correctly. All files including the one in the error message and after it, don't get copied.
If the first or only file is particularly large, the error may pop up. When the message does pop up, it is always after a few minutes of copying, never right away.
Never had this problem prior to the Mavericks upgrade. -
Hi. I am having issues with copying files to my shared WB 2TB HDD connected to my airport extreme. Comes up with error 50. I am using a Macbook Pro to copy from so not sure what I am doing wrong. Can someone help? thanks Rory
These links might provide some information that may be of help.
http://support.apple.com/kb/TA20831
https://discussions.apple.com/message/2035035?messageID=2035035
I've encountered this error myself upon occasion. If I remember correctly, it was a permissions/ownership issue with the some of the files I was copying. -
PC crashed. iTunes was on it and now all files are gone. All music both purchased and copied from CDs is on iPad. How do I get the music back onto the PC without using the cloud. Afraid if sync will wipe all music from iPad.
You would need to download iTunes on comp and download purchases again (you don't have to pay again) and upload your CDs again IF you sync your iPad to your computer it will erase everything
-
USB Drive Resets during file copy, interrupting file operations
Fresh Arch Linux install, working USB thumb drive (Windows, previous Arch Linux setups, etc.), formatted FAT32.
Seems to randomly reset, eject, and auto-re-mount during extensive file operations (i.e. copying 4gb worth of 800 files from the USB thumb drive to disk).
I've tried various USB ports to no avail; no external hub being used.
Thoughts? Not sure where to begin diagnosing:
dmesg:
usb 1-1: configuration #1 chosen from 1 choice
scsi17 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 15
usb-storage: waiting for device to settle before scanning
scsi 17:0:0:0: Direct-Access OCZ RALLY2 1100 PQ: 0 ANSI: 0 CCS
sd 17:0:0:0: Attached scsi generic sg2 type 0
usb-storage: device scan complete
sd 17:0:0:0: [sdb] 31326208 512-byte logical blocks: (16.0 GB/14.9 GiB)
sd 17:0:0:0: [sdb] Write Protect is off
sd 17:0:0:0: [sdb] Mode Sense: 43 00 00 00
sd 17:0:0:0: [sdb] Assuming drive cache: write through
sd 17:0:0:0: [sdb] Assuming drive cache: write through
sdb: sdb1
sd 17:0:0:0: [sdb] Assuming drive cache: write through
sd 17:0:0:0: [sdb] Attached SCSI removable disk
usb 1-1: reset high speed USB device using ehci_hcd and address 15
sd 17:0:0:0: [sdb] Unhandled error code
sd 17:0:0:0: [sdb] Result: hostbyte=0x07 driverbyte=0x00
end_request: I/O error, dev sdb, sector 7589504
sd 17:0:0:0: [sdb] Unhandled error code
sd 17:0:0:0: [sdb] Result: hostbyte=0x07 driverbyte=0x00
end_request: I/O error, dev sdb, sector 7589744
sd 17:0:0:0: [sdb] Unhandled error code
sd 17:0:0:0: [sdb] Result: hostbyte=0x07 driverbyte=0x00
end_request: I/O error, dev sdb, sector 7589776
usb 1-1: USB disconnect, address 15
FAT: bread failed in fat_clusters_flush
FAT: FAT read failed (blocknr 3805)
FAT: Directory bread(block 24147944) failed
FAT: FAT read failed (blocknr 3818)
<snip lots of repeats>
FAT: FAT read failed (blocknr 4032)
FAT: bread failed in fat_clusters_flush
FAT: bread failed in fat_clusters_flush
FAT: bread failed in fat_clusters_flush
usb 1-1: new high speed USB device using ehci_hcd and address 16
usb 1-1: configuration #1 chosen from 1 choice
scsi18 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 16
usb-storage: waiting for device to settle before scanning
scsi 18:0:0:0: Direct-Access OCZ RALLY2 1100 PQ: 0 ANSI: 0 CCS
sd 18:0:0:0: Attached scsi generic sg2 type 0
usb-storage: device scan complete
sd 18:0:0:0: [sdb] 31326208 512-byte logical blocks: (16.0 GB/14.9 GiB)
sd 18:0:0:0: [sdb] Write Protect is off
sd 18:0:0:0: [sdb] Mode Sense: 43 00 00 00
sd 18:0:0:0: [sdb] Assuming drive cache: write through
sd 18:0:0:0: [sdb] Assuming drive cache: write through
sdb: sdb1
sd 18:0:0:0: [sdb] Assuming drive cache: write through
sd 18:0:0:0: [sdb] Attached SCSI removable disk
lsusb -v for the drive:
Bus 001 Device 016: ID 0325:ac02 OCZ Technology Inc ATV Turbo / Rally2 Dual Channel USB 2.0 Flash Drive
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x0325 OCZ Technology Inc
idProduct 0xac02 ATV Turbo / Rally2 Dual Channel USB 2.0 Flash Drive
bcdDevice 11.00
iManufacturer 1 OCZ Technology
iProduct 2 RALLY2
iSerial 3 AA04012700275633
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 300mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 8 Mass Storage
bInterfaceSubClass 6 SCSI
bInterfaceProtocol 80 Bulk (Zip)
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 255
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 255
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)
Last edited by lieut_data (2009-12-26 17:39:56)Jithin wrote:
When ever I copy some files or create a file in my external USB drive which is a FAT32 one. file permissions are not preserved.
From <http://support.apple.com/kb/HT3764>:
"The MS-DOS (FAT32) file system format does not support permissions, file owners, and groups. Such permissions are synthesized on Mac OS X with some default permissions. Because of this all files will have the same permissions […]"
So it's not "how it work in mac", but it's a limitation of the FAT32 file system. -
Does OS X corrupt files when copying from SD card to desktop?
Using finder to copy a folder and its files from SD card to mac desktop seems to cause *some* files to be corrupted, specifically a handful of MP4 files from a FAT32 SD card which was used in a digital camera. Using a binary/hex comparison tool reveals that some segments of the files contents were modified when copied from the SD card.
This error occurs when copying multiple files using Finder windows. However, when copying the same files one at a time, the corruption does not occur. This appears to be an OS level bug. In reviewing past content, I found that dozens of MP4 files have been corrupted in the past 4 months by merely copying the files from the SD card to mac desktop using Finder copy/paste.
I am using OS X Mountain Lion 10.8.3Well, like I said, the byte size in fact did *not* change. So I'm not even concerned about that. What *did* change is the content of those bytes and it doesn't matter what operating system you are using, the content of those bytes is *not* supposed to change.
Also, like I said before, if I copy the individual file (MP4) insead of the entire folder, and then do the binary/hex comparison, the byte data is identical. i.e.
a) copying one file at a time produces an *identical* file on the HD, i.e. the byte count AND the byte content are precisely the same.
b) copying a folder with multiple files produces a *different* file on the HD, i.e. the byte count is the same BUT the byte content differs from the original file. -
Extremely slow file copy from USB 3 external Seagate on MacBook
I copied my iPhoto file of 20GB onto a new Seagate USB external drive from my 2011 MacBook in about 20 minutes over USB 2.0. I am copying up the same file from the same drive on my newer 2012 MacBook pro and it is taking 7 hours. The newer MacBook has a 750GB SATA SSD and is equipped with USB 3.0. Why would it take so much longer to copy from the drive to the newer Mac using a faster USB spec?
Well, I solved this myself with some searching on other threads. I turned off Spotlight indexing on the drive, and killed the copy job, disconnected and reconnected the drive, and the copy is now going quite fast. Will be done in lest than 5 minutes.
System Preferences> Spotlight>Privacy> Press the + and added the external drive.
Apparently, this is the default behavior of Spotlight, and the indexing was causing the bottleneck. -
File access privilege problem when copying from 9.2.2 to 10.5.6
Hello,
I have two Macs (one running MacOS 9.2.2, the other running 10.5.6) connected with an ethernet crossover cable. FileSharing over TCP/IP is enabled on both machines. When copying files from the 9.2.2 machine to the OS X one (initiated from the OS X side), after some files have been copied, I get an (OS X) error message to the effect of "insufficient file privileges for file "AppleShare PDS"", followed by a message "insufficient privileges for "Macintosh HD"" ("Macintosh HD" is the volume's name the data is copied from), after which copying terminates.
The FileSharing connection to the 9.2.2 machine is established using the only user on that machine, who has read/write rights on the entire source volume.
Both volumes have been checked with the respective OS's disk utilities and reported OK.
Any ideas how to solve this?Hi, chap -
You might try restarting, then immediately hold the mouse button down, keep it held down until booting has finished. That's a hardware-based command to the Mac to eject all removable media.
You can download any needed firmware update for your iMac from these Apple Kbase articles -
Article #58174 - iMac: When to Install Available Updaters
Article #86117 - Firmware Updates
As eww suggests, reposting to the iMac CRT forum may be of benefit; there are sometimes model-specific peculiarities when it comes to migrating from OS 9 to OSX. -
Hi all,
We are developing a tool which will control a copy file operation in any folder of Window Explorer base on file size limit.
If these copied files are not satisfied the file size condition (its size is larger than a predefined value), the copy/move operation must not be executed.
My question is that: "Are there any availability support of Windows API/tool for implementing this feature?"
BR,
Mr_LeHi Mr_Le,
Thank you for posting in the MSDN forum.
Based on your description, I’m afraid that it is not the correct forum for this issue, since this forum is to discuss:
Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor.
To help you find the correct development forum for this issue, please tell me the real project type (Winforms or others) and the real development language (C#, VB or others) you want to use.
If you are not very sure that which kind of project fulfils this requirement, maybe the language development forum would be better for this issue:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=vslanguages&filter=alltypes&sort=lastpostdesc
If there's any concern, please feel free to let me know.
Best Regards,
Jack
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Passing params from SQL file to Shell Script and then from Shell to SQL Fil
Afternoon guys,
Have a fun question for all you gurus in shell scripting out there. I have a shell script that is calling 2
different SQL programs. My objective is to pass a variable called request_number from one sql program
to the shell script and then from the shell script back to another SQL program. I will explain why I
need this to happen.
Here is what the shell script looks like which calls sql programs student_load_a.sql and
student_load_b.sql. Student_load_a.sql basically creates the control file (.ctl) which is needed for the
SQL*Loader and then student_load_b.sql reads the table that was just loaded and does the main
processing. My main objective here is to be passing the request_number which is being generated
using an Oracle Sequence in student_load_a.sql and using this generated number in my main
processing in student_load_b.sql to select records from the table based on request_number.
Any ideas ?Any help or recommendations is welcome and appreciated.
*1. Shell Script*
# Accept system input parameters
p_user_id=$1
p_job_id=$2
# Create control files for sqlload
sqlplus.exe -s $p_user_id @$STUDENT_PATH/student_load_a.sql $p_job_id
exit_status=$?
# Do sqlloads
sdesqlldr.exe userid=$p_user_id control=student_load-$p_job_id.ctl \
log=student_load-$p_job_id.log \
bad=student_load-$p_job_id.bad
exit_status=$?
# Main processing
# sqlplus.exe -s $p_user_id @$STUDENT_PATH/student_load_b.sql $p_user_id $p_job_id $p_request_number
sqlplus.exe -s $p_user_id @$STUDENT_PATH/student_load_b.sql $p_user_id $p_job_id
exit_status=$?
exit 0*2. student_load_a.sql (Would like to pass back the Sequence Number back to shell script and then use in student_load_b.sql*
-- Accept system input parameters
define p_job_id = &1
spool student_load-$p_job_id.ctl
select
'append into table TMP_STUDENT_LOAD
FIELDS TERMINATED BY '','' optionally enclosed by ''"''
trailing nullcols
(request_number CONSTANT ' || '''' || request_number_seq.nextval || ''',
student_id)'
from dual
spool off;
exit 0;
{code}
*3. student_load_b.sql (This is a big file so I am only adding code that is relevant for the SQL)*
{code}
declare
v_request_number number(6);
v_student_id number(7);
cursor cur_student_load is
select student_id
from TMP_STUDENT_LOAD
where request_number = v_request_number
order by 1;
begin
v_user_id := '&1';
v_job_id := &2;
-- This is the variable I would like to be be passing from shell script to student_load_b.sql
-- v_request_number = '&3';
open cur_student_load;
fetch cur_student_load into v_student_id;
exit when cur_student_load%notfound;
.... more logic of if then else in here
close cur_student_load;
end;
{code}
Edited by: RDonASnowyDay on Jan 29, 2010 4:03 PMHow come you are mixing WinDoze script (*.exe) with Unix?
You are aware that you will be passing the password along with the user id to the second sql script?
I will assume Unix ksh:
# Accept system input parameters
p_user_id=$1
p_job_id=$2
# Create control files for sqlload
p_seqno=`sqlplus -s $p_user_id @$STUDENT_PATH/student_load_a.sql $p_job_id`
exit_status=$?
# Do sqlloads
sqlldr userid=$p_user_id control=student_load-$p_job_id.ctl \
log=student_load-$p_job_id.log \
bad=student_load-$p_job_id.bad
exit_status=$?
# Main processing
# sqlplus -s $p_user_id @$STUDENT_PATH/student_load_b.sql $p_user_id $p_job_id $p_request_number
sqlplus -s $p_user_id @$STUDENT_PATH/student_load_b.sql \
$p_user_id $p_job_id $p_seqno
exit_status=$?
exit 0And the first sql script would look like this:
-- student_load_a.sql
-- Accept system input parameters
set echo off pages 0 feed off lin 80 trims on ver off
def p_job_id = &1
col seqno NEW_VALUE seqno
select request_number_seq.nextval seqno from dual;
set term off
spool student_load-$p_job_id.ctl
select
'append into table TMP_STUDENT_LOAD
FIELDS TERMINATED BY '','' optionally enclosed by ''"''
trailing nullcols
(request_number CONSTANT ''&&seqno'',
student_id)'
from dual
spool off;
exit 0;
{code}
:p -
Dynamically naming a file using a send operation in B2B
Hello,
I am using a send operation in B2b adapter which drops a file in a particular location.
Right now its dropping a file as default naming standard by B2B.
I just wanted to know that is there any way where we can do this dynamically?
for eg- fetching a value from the file and concatenating it to the file name pattern that is set in B2B?
need a solution.
Thanks!
Regards,
Shreya.Shreya,
As indicated by Nitesh, use the "preserve filename" in File/FTP/SFTP channel and set the filename from the middleware using ACTION NAME B2B header. If you are passing message to B2B using AQ/JMS then use action name as -
ACTION_NAME=contentType:application/octet-stream;filename:abc.xml
If you are passing message to B2B using fabric (default) then set below headers -
b2b.contentType
b2b.fileName
Setting Content Type is optional.
You may refer -
http://docs.oracle.com/cd/E23943_01/user.1111/e10229/b2b_tps.htm#BABBCDHI
Regards,
Anuj -
File dates of files copied from my iphone to my XP system are realy off!
Whenever a file is copied from my iPhone to my XP System via iTunes copy purchases, Sync, Etc... the file date of files copied are realy wrong! Extremely old dates are used insted of the actual date. In windows XP the file list can display three dates, The Created Date, The Modified Date and the Last Accessed Date. I think it's the accessed date thats coming up wrong. Anyone else experience this? or can anyone explain what might cause this.
Thanks!Sync is only oneway, from PC to your device. Unless you have the music on your PC, iTunes is going to wipe out what you have on your device if you are syncing to a new library.
You can only transfer Purchased music over to Itunes on your PC.
iTunes Store: Transferring purchases from your iOS device or iPod to a computer
http://support.apple.com/kb/HT1848
As for you own music, you may have to use a third party software. A good Free one is called Sharepod which you can download from Download.com here:
http://download.cnet.com/SharePod/3000-2141_4-10794489.html?tag=mncol;2
Maybe you are looking for
-
How do I connect to my WIFi with Netgear
I just received an iPad for Christmas and have Comcast internet also Netgear and a SonicWall. I can't connect to WiFi here at home. I could connect at my daughter's.
-
My phone recently no longer connects to my home wifi or any other wifi. I had it automatically set it up use the house's wifi. It hasn't been an issue for over a year. Any thoughts? I'm told that it can't make a connection to the wifi. I tried d
-
Disk IO efficiency in Bridge CS5 and Camera Raw 6.0
After watching Microsoft Process Monitor (ex-sysinternals) while processing a large batch of DNG's that in Camera Raw were being converted to a different Process (2010 to 2003) and a different a different Camera Profile, I have the following question
-
HRMS Certification Training Material
Hi , Please do let me know if any training materials available in for HRMS Certification. Please send me if any materials to <email address removed by moderator >. Thanks, Subbu.
-
Object Creation for Hierarchy in BW side
Hi Some hierarchies have been added in R/3 side for Account Group and Profit center group.In BW side i need to Create/maintain the infoobject for the same. Could anyone help me.How to go about this.I mean what are all the External chraracteristics i