General :: How To Exclude Multiple Directories

May 10, 2011

I am trying to exclude multiple directories when using tar. I can do it for just one directory with exclude= directory.I can also do it for multiple directories by typing that code again and again.As you can see im trying to call this variable that has endless amounts of directories in it seperated by a space.. but when run it doesnt work! It will however work if i just put one directory in the variable. Any ideas?

View 2 Replies


ADVERTISEMENT

General :: How To Exclude Multiple Directories In Awk With Find?

May 20, 2010

I found a script on webmaster world that mostly does what I need it to, but have been making modifications to tailor it to my specific needs.I know that //..*/ tells awk to ignore hidden directories, how do I define more directories to ignore? (i.e. temp, var, etc)? I've tried playing with prune before the awk command with limited success...I know that there are many ways to do the same thing and keep running into brick walls.

View 11 Replies View Related

General :: How To Exclude Sub Directories From ZIP CLI

Jul 22, 2010

I'm trying to create backup/archive my Ubuntu 10.04 system files (so I can restore it in case my system get corrupted). More specifically, I'm trying to zip the important files in my root directory not including my home directory (which includes my documents which I backup separately/more frequently) to an external hard drive attached via USB (called 'My Book').Since File Roller didn't give me quite the level of control I was looking for, I created a script that I could execute to backup and archive regularly.

View 1 Replies View Related

General :: Midnight Commander - Exclude Some Directories / Patterns When Doing Search

Apr 7, 2011

In Midnight Commander, is it possible to exclude some directories/patterns/... when doing search? (M-?) I'm specifically interested in skipping the .hg subdirectory.

View 1 Replies View Related

General :: Multiple Users To Create Directories Over SFTP So The New Directories Keep The Same Permissions?

May 15, 2011

I want to make a webserver with multiple users allowed to login through SFTP to a specific folder, www.Multiple users are added, lets say user1 and user2, and all of them belonging to the www-data group. The www directory has an owner www-data and a group www-data.

I have used chmod -R 775 on the www folder, but after I try to create a folder test through my SFTP server (using Filezilla) the group of the directory created has only r and x permissions, and I am not able to log in with the second user user2 and create a directory within www/test due to a lack of w permission to the group.

I also tried using chmod 2775 on www directory, but without luck. Can somebody explain to me, how can I make it so that a newly created directory inherits the root directory group permissions?

View 2 Replies View Related

General :: Rename Multiple Files In Multiple Directories/subdirectories Recursively?

Aug 23, 2010

I am to rename all the files within a directory (which contains multiple subdirectories) recursively without invalid characters.

I tried the coding posted above.

find . -type f -printf '%p
' | while read file; do
oldfile=$(basename "$file")
newfile=$(echo "$oldfile" | sed 's/[^A-Za-z0-9_.]/_/g')
if [ ! "$newfile" == "$oldfile" ]; then
echo mv "$file" "${file%$oldfile}$newfile"
code....

but I get an error on both of them stating "find: bad option -printf find: [-H | -L] path-list predicate-list"

View 9 Replies View Related

Debian Configuration :: Exclude Directories From Bootstrap Copy?

May 24, 2011

I have successfully created an iso of my current running system using live build with the --bootstrap copy option..As expected, the image is gigantic. I would like to be able to use live-build to create copy-of-host iso's, but with specific options to -exclude specific pathways (ie. music folders, picture folders etc). Is there a way to do this? I did run a configuration and build using an option similar to that found in tar (something like -exclude=/home/user/music) and it ran through without any apparent errors, however, there was not any iso image to be found.

View 2 Replies View Related

General :: Creating Multiple Directories?

Mar 28, 2010

I need to create subdirectories in about 300 existing directories - the subdirectory will have the same name in all 300 existing directories. How do I do this using the mkdir command using a regular expression or globbing?

View 3 Replies View Related

General :: Tar Multiple Directories Into One File?

May 15, 2011

I have found ways to tar a directory and exclude certain directories but is there a way to simply tar multiple directories (they are in the same directory) in to one .tgz file?

View 8 Replies View Related

General :: Checking If Multiple Directories Exist?

Apr 27, 2011

I have one file called test.sh and in that file I have the below code. All this code is, is paths to three directories (as you can you can clearly see!).

Code:
#!/bin/bash
BACKUP="Documents /bin /sbin"

Now I have this other file which reads the directories (by using $BACKUP) and creates a tar file of everything in that folder. But what I am unsure of what to is create a bit of code that will simply look in test.sh, read all the directories and print a line saying either they all exist or some are missing. If possible it would be good to know which directories are missing too!

I have fiddled around with using -d but I can only get it to work for one directory or manually having to write out each directory.

View 4 Replies View Related

General :: Copying Doc Files From Multiple Directories To One?

Feb 1, 2010

I have 60+ directory's each containing multiple .doc files. I need to move them to a single directory and keep their file name intact. I don't think cp will do that with out listing all the file names. I was thinking of something like: cp -r /dir/*.doc /newdir . Or should I use a combo like find -type *.doc|cp /newdir?

View 5 Replies View Related

General :: Remove Multiple Directories In Different Locations?

Mar 15, 2010

I have hundreds of directories in various subdirs that I need to remove. I want to remove all of these dirs, but can only find solutions on how to do remove files (or how to remove subdirs from within the current dir).

I think I need something like

find -iname 'testfile*' | xargs rm -i

where I want to remove every directory that contains the word 'testfile' within the directory name. I know xargs wont work for dirs,

View 9 Replies View Related

General :: Replace A String In Multiple File & Sub Directories?

Aug 31, 2010

Need to replace the following string :

By

In multiple .exp files and in sub directories.

View 5 Replies View Related

General :: Move Some Of The Files From Multiple Directories To One Location?

Jun 17, 2010

I'd like to move a selection of files from all the sub-directories within an overall directory to a single destination. I don't want any of the directory structure, just the files themselves. This is what I tried so far:

mv /dir1/*/igs*.sp3.Z /dir2

There are other .sp3.Z files in the * directories within /dir1 but I just need the ones that start with igs..

View 4 Replies View Related

General :: Use Exclude Option In"rm" Command To Exclude Some Files/folders?

Feb 3, 2010

i have created on folder in my server to upload some regular states. I want that user can modify or upload already stored files. but, should not upload any unwanted files orfolders.for that i want to use "rm" command as auto scheduler (putting this in cron tab.so that all files will be removed except some required files / folders for which this upload facility is activated. users are using secure-shell for uploading data.

View 1 Replies View Related

General :: Extract To Multiple Directories Based On File Names?

Jan 30, 2009

I'm not sure if this is possible or even where to start. I assume that this can be done with an sh script using tar or similar.I have several very large zip files that contain images for all of the products in my online store. Each image is named after its 13 digit SKU (for example, 9987788000012.jpg). In order to import products into my store, all images are placed into a media directory. Unfortunately, there are over 100,000 images.

So I would like to break the images into sub-folders based on file name. For example, when I extract store_images.zip (or tar or whatever), my extract script would create directories (if they don't already exist) based on the first three digits of each image name, placing each image into the appropriate bottom level directory. For example, "9987788000012.jpg" would be placed in the following directory "media/9/9/8", with media as the root and "8" as the directory that holds any images that start with "998". Perhaps two sub-folders would be less cumbersome.Assuming this requires a script, particularly since it involves scanning image names, creating folders, and saving images to specific directories, which language would serve my needs best? PHP? Has anyone had to do something similar?

View 13 Replies View Related

General :: Bash - Mirroring Of Multiple Directories - Hard Linking

Apr 11, 2011

I have 5 FTP users that upload files (and subdirectories) in their home directory, i need to mirror theese directories beetween them and with a "master" directory (accessible from a 6th user). Files can contain spaces or others special caracters. All the files are in the same filesystem, and i want to use hard link because i don't want to waste 5 time the space of a single file. I tried with find but i cannot handle spaces in it.

View 1 Replies View Related

General :: Copy A Set Of Sub Folders From Their Multiple Parent Directories To A New Location

Nov 5, 2010

I am attempting to copy a set of sub folders from their multiple parent directories to a new location.

For example, I have three folders to copy:

I would like them to be copied to:

In actuality there are many folders besides folder1, folder2, folder3, and no numerical order exists. So, the folder named 'photos' would be copied to its parent folder's name in a new location. I would need this to occur for all folders in the '/home/user' directory.

View 6 Replies View Related

General :: Automate Copying Files To Multiple Directories With Log For Admin

Sep 30, 2009

Description: I am a newly appointed system engineer taking care of linux servers. We have a new set of data coming in which need below configuration: How to do a script with function?:

for files with ".txt" in sm
copy each of the files to folder : sm1 and sm2 (log every copy)
if succesful:
remove original
log into the log file
if not successful: (not successful copying 1 particular file to all the folders)
retain and retry
log into the log file
mail out the admin with that particular file name

I have already do try a bit:
cd /export/home/
for dir in sm1 sm2; do
cp -p sm/*.txt $dir/
done
Is my starting right? How to do the rest parts?

View 6 Replies View Related

General :: Replace ":" From Multiple Files Names - Even Recursively In Directories

Jan 31, 2010

I need to replace ":" from multiple files names, since I am going to copy those files from a linux partition, which admit the ":" to a FAT32 partition, which does not.

Example:
original name: eg06_ana_21-05-06_09:21:03.JPG
wished name: eg06_ana_21-05-06_09-21-03.JPG

I have googled a lot but I have not been able to adapt the examples given by people to my aim.

It seems that rename command is what I should use, but I have no idea to build the correct pearl expression.

View 3 Replies View Related

General :: Creating A Script To Move Or Copy Files Into Multiple Directories Below The Files?

Aug 25, 2009

How can you create a script to move or copy files from a main directory into multiple directories below the main directory.

View 7 Replies View Related

Ubuntu :: Moving Files From Multiple Directories?

Apr 16, 2010

I have a directory tree with lots of folders. I need to gather all files of same type, say .txt, and place them in a different folder all by themselves.

I know I can use the mv command, but it won't let me go through all the subdirectories of my folder, just the current one. How can I search through all subdirectories for all .txts or whatever and move them to a folder of my choosing?

View 2 Replies View Related

General :: Create A Backup Directory And 3 Directories Within That And Some Files Within The 3 Directories And Then Back Them Up Ot Restore Them?

Dec 19, 2009

i am in need of linux help. iam at college and i need this back/restore script to pass this final part of an assessment. i require a backup script that will not only backup but also restore files to the relevent directories. e.g. users are instructed to store all wordprocessor files in a directory named wp. so i am needing to create a backup directory and 3 directories within that and some files within the 3 directories and then back them up ot restore them. l know i should/have to do this myself by been trying to get/understand info for the last few days and came up with zero.

View 14 Replies View Related

Ubuntu :: Deleting Multiple Folders In Different Directories With Filezilla?

Apr 21, 2011

So I have a share hosting account with 60 sites all running wordpress.

There is a plugin I want to delete from all 60 wordpress sites.

The plugin is in the same path in all 60 sites.

mysite.com/wp-content/plugins/carter Is there a way I can search the entire home directory with filezilla or another ftp and delete every folder with that name in every site or I have to do it the tedious 1by1 sucky way?

View 4 Replies View Related

Ubuntu Servers :: Samab With Multiple Users Accessing Different Directories?

Apr 16, 2010

I currently have samba setup and connecting. What I am trying to do is have multiple users with access to different directories. For example , let's say there are folders A B C on my Linux machine. I want one guy to see A and C and another guy to see B and C and a third guy to see them all. But I want each user to have access to change delete or execute the files within these directories that they have access to

View 4 Replies View Related

Ubuntu :: Move Logs From Multiple Directories Into One And Avoid Name Collisions?

Jan 25, 2011

What I need to do is gather a bunch of log files from various directories and move them into one spot. Below shows the directory structure.Quote:

dir1
-a.log
-b.log

[code]....

View 4 Replies View Related

Software :: Gnu Tar Creates Multiple Odd Directories With Numeric Names When Extracting?

Feb 4, 2010

I become to use tar with incremental feature for archiving data under ubuntu.But when I try to extract archive later under windows (using gnu tar also) it creates many directories like this:

<...>
11324447220
11324447221

[code]...

View 2 Replies View Related

OpenSUSE Install :: Mount Multiple Directories From Two Archive Drives In One Folder?

Jan 21, 2011

I have two non-system drives with archive files. Each drive is formatted with one primary partition only, occupying all the drive space. In each drive there will be a number of directories with files in them, like this:

Drive 1:
/directory1/directoryXXX/files
/directory2/directoryXXX/files
/directory3/directoryXXX/files
Drive 2:
/directory4/directoryXXX/files

[Code]...

View 2 Replies View Related

General :: How To Store Files / Directories In Different Different Directories?

Mar 23, 2011

I am writing a script, in that my requirement is, if all the fill types stored in one directory from that we need to separate different different directories based on the file types.

for example in a directory(anish). 5 different types files
1- directory
2- .txt files
2- .sh files

like that and my requirement is the (1- directory is moved to one new directory(dir) which we are given in the script)and (2 .txt files are moved to another new directory(test) which we are given in the script)and ( 2 .sh files are moved to another new directory(bash) which we are given in the scrip)finally the directory anish should be empty..using bash script.how it is possible !!

View 7 Replies View Related

Ubuntu Servers :: Change The Ownership Of Multiple Files And Directories Under A Specific Subdirectory?

Feb 19, 2010

I have a vary unique problem with file and directory ownership. I need to change the ownership of multiple files and directories under a specific subdirectory.Under this directory structure there are files and directories owned my different users and groups. I need to change all files and directories owned by "user1" to "user2". but if any are owned by "user3" I need those left alone.Is there a simple way to do this or will I need to traverse the structure and change things one at a time.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved