I have very little linux experience. And need some help with a bash script. I need to a script I can set cron to run to sort files out of a holding folder into final folders. It doesn't necessarily have to be bash, but I think it would be sufficient for this. File names are formatted as such when created: Dest-Date-Time-CID-Destination# I want the files to be moved from a all in one holding folder to a folder structure like this.
So the script will need to make directories based on information in the file name which is delimited by single dashes. Then move files from the holding folder to the newly created "sorted" folders.
I am trying to read mulitple files and copy its contents (files) to a respective directory. I have a folder "Oracle". Under this i have mulitple files as mentioned below.
Each of the above has a list of files in them.
Now i have created new directories with the same name as the above files in another location say
The script that i looking at has to read the files from Oracle, backup its contents to its appropriate new directory.
I have directory a and directory b. They are big. b is almost identical to a. "almost" means that 4-5 files differ, and I don't know which they are. I want to copy b over a, but only the files that differ. i'm in bash.(no, I can't simply delete a and replace it with b, because 1) a is version-controlled 2) a full copy (or a mv) would take too much. I want to copy only the files that differ).
I was trying to develop a script which needs to check the count of files on hourly basis and if it find any addition it has to sftp and send a email on the status with filenames and number of files copied via sftp. I will put it on cron to run every hour.
I'll use ls /abc|wc -l to count the no. of lines for the first time and from then whenever a new file will be inserted it'll copy that file to another location or I'll take the date of the files and whichever is having a new date that will be copied to another location.
copy a compact flash card with a form of Linux on it (Found out it was custom version based on Fedora Core 3). The flaky USB card reader seems to have hosed the flash card, it shows up with unknown volume after ejecting the card and reinserting it. My troubleshooting: I have Ubuntu on a flash drive that I used to start all this to read the flash card.
- I tried Disk Utility to reformat the card as Master Boot Record and the volume as ext3 with flag set to Bootable and copied the files using cp in command line.
- I tried ISO Master & mkisofs to make an ISO that the USB thumb drive tools can use, but it wouldn't copy all the files. Looks like symbolic links either were ignored or couldn't find the source file with -f.
- I learned that I might need a boot partition with a boot image, which I think I have in initrd-2.6.14.7img, but I don't know how to do that. Do I also need a swap partition?
My updated goal: using the files from the flash card, make a bootable compact flash card with Fedora Core 3.
I am using my media server as my podcast collector. I am in the process of learning the ins and outs of NFS so i can mount a NFS directory and transfer my podcasts from server to player. For now i am using scp to transfer podcasts from server to desktop then to player. The problem is the path to the directory of one of the podcasts is /home/user/gpodder-downloads/The BILL&TIMMY Show Podcast.
whenever i try and run my scp command it fails because it thinks that TIMMY is a script i want to run in the background. I have tried to back-slash escape the character, i've tried single quoting and double quoting the character and i still get the same problem. as it sits now i have to move all podcasts to another directory and then transfer them to my desktop...but i would like to transfer the podcasts without un-necessary steps.
What is the correct way to copy a file or directory to another directory? In the past I was able to use press the mouse left and right button, it didn't work all the time hard to press the two buttons at the same time. With the Fedora 14 it does not work at all.
What is the best and simplest way to compare two directory structures without actually comparing the data in files. This works fine: diff -qr dir1 dir2 But it's really slow because it's comparing files too. Is there a switch for diff or another simple cli tool to do this?
I need to copy all subdirectories and files from one directory to another ever 5 minutes or so, with the old data automatically being overwritten with the new data. I'd also like this to run at startup. Is there any way this can be done? If so, what program would I need to schedule the automation and what is the command line I would need.
I have a server that I wanted to transfer it to a newer one both of them have CentOS but the newer one kernel is more up to date I wanted to know is it possible just to copy some directory contents exactly to another for transferring the server data (for example /var /usr /bin /home /etc). I have one website on my server with its mysql database
i want to copy a few files from my windows directory into the wine directory - its no big deal, just a few preference files so i dont have to set something up all over again. trouble is, i had the files copied, but i cant find the wine/ c: drive directory anywhere, anyone know where this can be found??
After i try to find logfiles follow date/month/year. i want copy this files to another directory with name's directory is time you find(date/month/year).
I'd like to copy a file, say widgets/water.txt, to all subfolders in the folder widgets using a single command. So if the folder widgets has 10 subfolders like widgets/blue, widgets/green, etc. I'd like to copy water.txt to all of them with one command.
I tried the commands
Code:
cp water.txt ./*/water.txt cp water.txt ./*/
However these don't seem to work. The latter gives 'cp: omitting directory' errors.
Create a copy of the file above and call it commands.sorted. Use the vi command to manually sort this file. I.e. use yy to copy a line, P or p to paste a line, and dd delete a line. Order the commands with the two lines starting with double quotes first. Then list the rest of the command in alphabetical order.
Anyone have any ideas what he's talking about? Can I copy a file and rename it at the same time while copying it to the same exact directory again? Now sure what the two lines things means either. I have an email out to him but it usually takes a long time for him to answer me. I got alot of work to do so everytime I get hung up it kills me.
I downloaded a mouse theme form gnome look and installed it in the themes. But it has not appeared in the pointer themes section in custimation even though it said that it is installed correctly.When I drag the file to install it again it says something along the lines of it cannot copy a directory over a directory.Where can I find where the mouse/pointer theme is located and delete it. I have searched filesystem, google and these forums and not had any luck yet.
-the command to copy the file Practice.txt to a new name of Myfile.txt while in the home directory-found -command to create a directory in the home directory-found -say i just created a new directory called "test". whats the command to delete the test directory.-found -command to create a blank, text file without using an editor. -the exact syntax in Linux you would need to rename the file to a new name-found