Copying files into two directories
I would like a solution about how can I do that whenever somebody places something in a specified directory, some daemon immediately sync it to a backup directory, keeping the original tree structure. Not scheduling, but immediately copy, as soon as the original copy ends.
But only on copying. I don't want to delete automatically anything from the backup dir.
I know it looks like a lame question, but I can't find a good solution by myself.
R00KIE wrote:
That sounds a lot like you want to snoop on someone else
If you specify your problem better maybe someone might have some experience with it and suggest an appropriate solution, you may want to say if you want to "backup" only text files or all files.
Nothing illegal
I'm a sysadmin at an office. We have a fileserver, from which I do a weekly backup to a portable USB drive. Some days ago I deleted everything from the USB drive as I prepare to do the weekly backup and that very moment I finished the wipe, one of my colleagues accidentally deleted something important from the server. As I wiped the backup a minute ago, there were no backup to restore those files.
That is I want to avoid in the future with this secondary backup.
anonymous_user wrote:Perhaps look into fsniper?
I'll look into it, thanks
Last edited by Lenry (2012-07-28 07:05:09)
Similar Messages
-
How to copy data in text file into two-dimensional arrays?
Greeting. Can somebody teach me how to copy the input file into two-dimensional arrays? I'm stuck in making a matrix with number ROWS and COLUMNS according to the data in "input.txt"
import java.io.*;
import java.util.*;
public class array
public static void main (String[] args) throws FileNotFoundException
{ Scanner sc = new Scanner (new FileReader("input.txt"));
PrintWriter outfile = new PrintWriter("output.txt");
int[][]matrix = new int[ROWS][COLUMNS];
}my input.txt :
a,b,c
2,2,1
1,1,1
2,2,1
3,3,1
4,4,1
5,5,1
1,6,2
2,7,2
3,8,2
4,9,2
5,10,2import java.io.*;
import java.util.*;
public class array {
public static void main(String[] args) throws IOException {
FileInputStream in = null;
FileOutputStream out = null;
try {
in = new FileInputStream("input.txt");
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
String line = null;
while ((line = reader.readLine()) != null) {
String split[]=line.split(",");
catch (IOException x) {
System.err.println(x);
} finally {
if (in != null) in.close();
}}}What after this? -
Permissions problem copying files between two Macs
I've run into a strange problem when trying to copy files between two networked Macs. Some background facts: We have two Macs at home each with three accounts. Two of the accounts are regular user accounts (my wife's and mine, call them "K" and "B" for short) and the third is an administrator account (we'll call it "A"). I have a .Mac account, which I use to sync between the two Macs. The other accounts do not. The user accounts B & K were initially set up on the second Mac via the Migration Assistant, copying over files and settings. The administrator account was not.
The problem I've run into is that if I am logged in as either user B or K on the local Mac, connect to the remote Mac as the corresponding user, and try to copy files into a folder owned by that same user on the remote Mac, I get a series of three dialog boxes with error messages:
1) "You may need to enter the name and password for an administrator on this computer to change the item named ..." (stop/continue)
2) "The item ... contains one or more items you do not have permission to read. Do you want to copy the items you are allowed to read?" (stop/continue)
3) "The operation cannot be completed because you do not have sufficient privileges for some of the items."
If I go all the way through this hitting continue / OK on each, what shows up on the remote computer at the end is an empty file with the name and filetype of the local file that I was trying to copy, but of zero length.
This only happens when I'm copying from (local.B -> remote.B) or (local.K -> remote.K). It does not happen if I try any of the other pairwise combinations (assuming that I've authenticated properly): (local.B -> remote.K or remote.A), (local.K -> remote.B or remote.A), (local.A -> remote.B, remote.K or remote.A). It happens regardless of which Mac is local and which is remote.
I'm a little baffled. I've tried to search for this on Apple Discussions and other forums, but either haven't been using the right keywords or am coming up blank.
Anyone have any suggestions?
Thanks,
Bobborbye is correct that this will remedy the problem but there is a way to do it and have your account work. after changing the user UID and group UID to 501 you will have to restart. then when you log on your home folder will still be your default but you will not have any access. Since you are still an admin you can change that. right click on the home folder and select get info click arrow for sharing and permissions. Your old UID account will show up as _unknown delete this user and add your user to it giving yourself read and write privilege. click on the cog on the bottom and select apply to enclosed items. A warning box will appear stating that this process cannot be undone do you wish to proceed? click yes and a status bar will come up. once the bar is gone the process is complete. since you didn't have access to your home folder you cannot save your settings, this is a good thing since your account will not look remotely the same as yours most likely. all you have to do now is logout and then back in. Your account will look as it did before the change with all the access settings and so forth as before the change... minus some permissions due to the overwrite. It's a minor repair to the permissions to some shares considering you will be able to now move files to and these shares without the permissions alert that only creates a 4kb file instead of the real thing. Takes 5 minutes at most. Have fun.
-
Drop the files into different directories based on the filename
Hi,
I had a reqiuirement based on the file name, i should drop the files in to different directories.
I can get the filename through variable substitution in receiver file communication channel, now i want to drop the file into different folders based on conditions.
suppose, if the file name is DDDX234
i should do substring of filename0+(4), if the value is L then i should drop in X directory
suppose, if the file name is DDDY234
i should do substring of filename0+(4), if the value is L then i should drop in Y directory.
How can i drop the file into differnent directories based on filename.
Thanks
SrinivasThanks Michal,
I mapped the directory and filename to the target header in the mapping
Filename --> UDF --> Header(target)
and in the receiver channel checked the ASMA and given * in the filename and directory name.
But in runtime iam getting the error as
Attempt to process file failed with com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message header
MY UDF is
public String Directory(String a,Container container){
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "Directory");
String FileName = conf.get(key);
FileName = a;
conf.put(key, FileName);
%%%based on filename the directory should change
String Directory = conf.get(key1);
Directory = "/SAPInterface/XI/PPD/DHX/out";
conf.put(key1, Directory);
return "";
Help me in correcting this error.
Thanks
Srinivas -
How to write file into multiple directories by using file adapter?
i need to write my file into multiple directories,i able to do in single directory.But i need to write to muliple directories.Please help me out.Thanks in advance.
If you are passing the values at runtime then you can loop it and and invoke the file adapter in loop by dynamically passing the value in invoke properties for "File Directory and File name" etc.
-
T-code to upload mutliple files into SAP directories ?
Hi,
Is there any other transaction to upload multiple files into SAP directories ( ALL11) other than CG3Z ? Any other procedures at the operating system level ? Please advise.
Regards
ShivaI dont think so. But you can :
-- Ask your developer to create a BDC for this transaction to upload multiple files.
-- Use LSMW to record this transaction to upload multiple files.
Regards,
Jazz -
How can I sort a sequence files into two new folders in Automator?
I have a folder with 2000 files. I need to sort these files into two folders. I have sequentially renamed the files in automator so that a number is the first character of each file. I need to put the odd numbered files in folder one and the even numbered ones in folder two.
I can do this sort in a spreadsheet. How do I get the resuls of the spreadsheet sort back into automator?
Or is there a better way to do this within Automator?
G4 17 PB Mac OS X (10.4.2)Open the Script Editor in the /Applications/AppleScript/ folder and enter the following:
tell application "Finder"
set source_folder to folder "folder:with:2000:items"
set folder_1 to folder "folder 1"
set folder_2 to folder "folder 2"
repeat with this_item in (get items of source_folder)
if (item 1 of (get name of this_item)) mod 2 is 1 then --odd number
move this_item to folder_1
else
move this_item to folder_2
end if
end repeat
end tell
Insert the paths to the actual folders in lines 2, 3, and 4.
(14737) -
How to split a file into two small file
Hi All,
I want to raed a file from FTP server.Then i have to split a file into two small file.File format look like this.
R01!service_order!item_guid!resource_guid!assignment_guid
R02!Service_order!product_id!product_discription!quantity
R02!Service_order!product_id!product_discription!quantity
R02!Service_order!product_id!product_discription!quantity
i want split file into 2 file,according to header and item details.one table containt header information (label R01) and second table containt (label R02).
can anybody help me for this.how can i split into 2 file.
Thanks
Vishwas SahuCreate 2 internal tables. sat it_header, it_detail
Check for 1st 3 characters and if it is R01 then send it into it_header and if it comes out to be R02 then send it to it_detail.
Once done... You can either attach these tables into mail as two seperate files
Or you can download each internal table using GUI_DOWNLOAD.
Hope this helps!!
Kanchan -
Permission Error when copy files into cmsdk using NFS with non admin user
Hi All,
We are using CMSDK with NFS protocol and we have created different users with ACL to control different access for users.
When we copy files into cmsdk folders using one of the admin user this works fine, even a multiple copy works fine. But when we use any non admin user , some time copy commands works but some time it throw a permission deny error. and this is happening very intermittently.
when we use ftp protocol and ftp file it's all works fine for the both admin & non admin user. Is there any limitation in using CMSDK NFS protocol
Did any one encouter any similar issue. Any pointers would be of great help.
Thanks in advance
Regards,
NavinHi All,
We are using CMSDK with NFS protocol and we have created different users with ACL to control different access for users.
When we copy files into cmsdk folders using one of the admin user this works fine, even a multiple copy works fine. But when we use any non admin user , some time copy commands works but some time it throw a permission deny error. and this is happening very intermittently.
when we use ftp protocol and ftp file it's all works fine for the both admin & non admin user. Is there any limitation in using CMSDK NFS protocol
Did any one encouter any similar issue. Any pointers would be of great help.
Thanks in advance
Regards,
Navin -
Copying files into output directory automatically
Hi
I got two font files (e.g. a.ttf and b.ttf) which I want to be copied inside ViewController\classes automatically when I run the application.
I copied them into ViewController\src but it didn't work. What should I do? Is there anything to be set?
Currently I do the copy manually each time I checkout a fresh copy of the project.
Anyway, I am using JDev 11.1.1.4.0
Thanks,
FerezHi Timo
I went to ViewController > project properties... > Deployment > Edit war file > WEB-INF/classes file group and added the font files there. Now the font files get copied into the proper directory in the ear file automatically when deploying the application but the main problem remains unsolved. I mean the files don't get copied into ViewController\classes directory yet.
Regards -
Any suggestions?
However, I can use scp to copy files out from my iMac (10.6.8) .
I can ssh into the iMac OK.
I created a .profile in my iMac home directory with the single line "export TERM=xterm-color".
This makes a difference to how scp behaves when attempting to copy into the iMac, but it still fails.
Thanks in advance for any help. Peter R
Here is the scp debug output (on the remote machine that I'm copying a file from, to the iMac):
===
Executing: program /usr/bin/ssh host molika.ucsd.edu, user prowat, command scp -v -t Desktop/FromPelican/Outs201201.pdf
Sun_SSH_1.1.3, SSH protocols 1.5/2.0, OpenSSL 0x0090704f
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug1: ssh_connect: needpriv 0
debug1: Connecting to molika.ucsd.edu [137.110.243.133] port 22.
debug1: Connection established.
debug1: identity file /home/nona/.ssh/identity type -1
debug1: identity file /home/nona/.ssh/id_rsa type -1
debug1: identity file /home/nona/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_5.2
debug1: match: OpenSSH_5.2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-Sun_SSH_1.1.3
debug1: use_engine is 'yes'
debug1: pkcs11 engine initialized, now setting it as default for RSA, DSA, and symmetric ciphers
debug1: pkcs11 engine initialization complete
debug1: Failed to acquire GSS-API credentials for any mechanisms (No credentials were supplied, or the credentials were unavailable or inaccessible
Unknown code 0
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: Peer sent proposed langtags, ctos:
debug1: Peer sent proposed langtags, stoc:
debug1: We proposed langtags, ctos: i-default
debug1: We proposed langtags, stoc: i-default
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: dh_gen_key: priv key bits set: 124/256
debug1: bits set: 1007/2048
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'molika.ucsd.edu' is known and matches the RSA host key.
debug1: Found key in /home/nona/.ssh/known_hosts:1
debug1: bits set: 1043/2048
debug1: ssh_rsa_verify: signature correct
debug1: newkeys: mode 1
debug1: set_newkeys: setting new keys for 'out' mode
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: newkeys: mode 0
debug1: set_newkeys: setting new keys for 'in' mode
debug1: SSH2_MSG_NEWKEYS received
debug1: done: ssh_kex2.
debug1: send SSH2_MSG_SERVICE_REQUEST
debug1: got SSH2_MSG_SERVICE_ACCEPT
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /home/nona/.ssh/identity
debug1: Trying private key: /home/nona/.ssh/id_rsa
debug1: Trying private key: /home/nona/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
*** Password requested & supplied
debug1: Authentication succeeded (keyboard-interactive)
debug1: fd 5 setting O_NONBLOCK
debug1: fd 6 setting O_NONBLOCK
debug1: fd 7 setting O_NONBLOCK
debug1: channel 0: new [client-session]
debug1: send channel open 0
debug1: Entering interactive session.
debug1: ssh_session2_setup: id 0
debug1: channel request 0: env
debug1: Sending command: scp -v -t Desktop/FromPelican/Outs201201.pdf
debug1: channel request 0: exec
debug1: channel 0: open confirm rwindow 0 rmax 32768
~
debug1: channel 0: read<=0 rfd 5 len 0
debug1: channel 0: read failed
debug1: channel 0: close_read
debug1: channel 0: input open -> drain
debug1: channel 0: ibuf empty
debug1: channel 0: send eof
debug1: channel 0: input drain -> closed
debug1: channel 0: write failed
debug1: channel 0: close_write
debug1: channel 0: output open -> closed
debug1: channel 0: rcvd eof
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: rcvd close
debug1: channel 0: almost dead
debug1: channel 0: gc: notify user
debug1: channel 0: gc: user detached
debug1: channel 0: send close
debug1: channel 0: is dead
debug1: channel 0: garbage collecting
debug1: channel_free: channel 0: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
debug1: fd 2 clearing O_NONBLOCK
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.9 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 0On looking at the secure.log on the iMac with OSX10.6.8, I see these entries at each attempt to scp into the iMac:
Dec 29 11:06:20 molika sshd[7248]: in pam_sm_authenticate(): Failed to determine Kerberos principal name.
Dec 29 11:06:26 molika sshd[7246]: Accepted keyboard-interactive/pam for prowat from 137.110.243.132 port 35571 ssh2
Dec 29 11:06:26 molika com.apple.SecurityServer[26]: Session 0x236a14 created
Dec 29 11:06:26 molika com.apple.SecurityServer[26]: Session 0x236a14 attributes 0x20
Dec 29 11:06:27 molika com.apple.SecurityServer[26]: Session 0x236a14 dead
Dec 29 11:06:27 molika com.apple.SecurityServer[26]: Killing auth hosts
Dec 29 11:06:27 molika com.apple.SecurityServer[26]: Session 0x236a14 destroyed
I don't know what to make of this.
Peter R -
How do you get copied files into a folder of our choice?
OK so this may sound like a very basic question, but it has been driving me nuts ever since I bought an Apple Mac some 3 years ago and I find it hard to believe there isnt a solution.
Objective: to copy or import files into a folder previously created by me within Apples 'Pictures' folder. E.g. "Holiday 2012".
Problem: on every program I have used, inc iPhoto, iMovie, and just now, Preview, when I get ready to copy or import say my photo files from my iphone, or an SD card or a network drive, it never gives me the option to navigate to my folder! How mad is this?! Instead I get teh choice of just Apples plain old Documents or Pictures folders but NEVER get given any opportunity via the dialog box to navigate to my "Holiday 2012" folder. There just is not any obvious way to do it. So instead I get my hundreds of pictures listed directly under Pictures folder, to therefore added to all the other hundreds of pictures listed there. A terrible way to kep pictures.
What I need: someone to tell me how to do this or if its not possible then to tell me that. It is a basic operation that I have been able to do on Windows PC's since they were built. Wht not on Mac? Maybe the solution is right in front of me... if it is then its not intuitive, thats all I can say!
Can you help please?Hi. Ok.
I have just tried the process again in Preview and in desperation this time clicked on 'Other' in the dialogue box when trying to Import. Low and behold I found the way to navigate to my own folders instead of being forced to use Apples standard Folders called Documents and Pictures.
So problem solved.
Its daft that you cant click on the first folder names listed like you can in Windows so you can then reveal the subfolders. I guess its just another Apple-ism. Too bad it took me three years to find it but then I suppose I gave up early. -
Please Help! After downloading an album and dragging it into itunes I end up having multiple copies of the album on my hard drive. I do have (under Itunes preferences, advanced) copy songs into itunes library "checked". I'm sure this is the reason for the multiple copies. When I try to delete one of the copies of the album and go back to itunes and try playing a song, I get a red exclamtion point next to the song with an error message saying itunes cannot locate file. My questions are, Does Itunes literally make a copy of the song? If so , How do you know which file to delete?
Sony's own entertainment software on the Vaio plays merry **** with iTunes, worse there's no telling when it will kick in.
First head over to the Sony Vaio site and get the update for the software, that will stop it from messing with the iTunes database/library files when you connect your iPod.
http://support.apple.com/kb/TS2715
http://esupport.sony.com/US/perl/swu-download.pl?mdl=VGNP588EQ&updid=4526&osid=28
With that stopped you can add the music back without fear of this happening again. -
Does copying files into the iTunes library take up even more space?
Hi everyone, I recently upgraded to Leopard and decided to give Boot Camp a try so I backed up everything onto my external hard drive using Time Machine and created my partition for Windows. In doing so, I know have an empty iTunes library.
I just copied everything to my hard drive using Migration Assistant, and although all of the files were locked because I didn't have enough "permission", i fixed that problem. However, when I tried to copy all of my itunes folders into my library, it said that I did not have enough space on my computer for it.
Dose copying music into the library use even more space than what it already is? I'm confused, because I thought that if i have the music files in my computer already I don't need to make another copy of it to place into iTunes...or maybe I'm just confusing myself.
Could someone please just let me know how I can add my music into my library? I really don't think this should be so difficult, I'm just terrible with computers. Thanks!Under Preferences -> Advanced you can uncheck "copy music to iTunes folder", this should fix your problem.
Hope this helps. -
How can I create an extension that when added automatically
adds a required file/folder to the current dreamweaver website?
I've seen other extensions add javascript and .gif files and
folders but I cannot find any tutorials on how to do this.
Example is: I have an extension that places a link to a local
file. I need to add that file into the users dreamweaver site so
they can ftp it along with the webpage.
Thanks in advance"gjhdigital" <[email protected]> wrote in
message
news:fcmiee$4mf$[email protected]..
> thanks for responding, but what my extension is doing is
adding some html
> to
> the page along with some javascript mouse events, and I
am referencing a
> seperate .js file that has the functions that will need
to be added
> automatically to the site in the same folder as where
the webpage is. I
> dont
> want the developer using my extension having to go and
search for my .js
> file
> and then add it to their site. I want it to copy their
once they finish
> using
> the extension.
>
> Do you know how to do that?
> thanks
Sure, Dreamweaver CS3 introduces the function dom.copyAssets,
http://livedocs.adobe.com/en_US/Dreamweaver/9.0_API/dwr_pagecontent_cn_088.html
you pass it an array of AssetInfo objects, which are defined
in
Shared/Common/Scripts/AssetInfoClass.js
for earlier versions of dreamweaver you'd have to create your
own function
using DWFile.copy
http://livedocs.adobe.com/en_US/Dreamweaver/9.0_API/dwr_fileio_fi_04.html
Joris
Maybe you are looking for
-
I've downloaded iTunes. I downloaded the myView app. I can't get it to work. It's in my library. I doubleclick on it and it just sits there and doesn't respond. It is very very important that I get this app to work today!!! Help.
-
HT204154 monitor display problem
I have an early 2009 24 iMac and a late 2009 27 iMac. The 27 has that common problem of the monitor going black. And staying black. Computer runs fine, but screen goes black. The monitor of the 27 goes black. Has been black for months. So I use an e
-
Can i create and use my own apple ID and still have the music from my sisters account?
I share an itunes account with my sisters and they wont let me use my imessage or facetime because it shows up and says what ive been doing and they dont want that. So can i make my own account so i can use imessage and facetime but still get my musi
-
I have CS4 and a new comp. & printer & still when i print the image printed is an 1/8 of the size
-
Deskjet 720C ques but doesn't print
Old reliable 720C ques info to be printed but printer does not activate and produce hard copy. Am running SP. Have latest driver installed. Have gone through all inventoried printer ports with no activation of printer or document production. No ot