mv hidden folders


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting mv hidden folders
# 1  
Old 11-12-2009
mv hidden folders

Hi guys!

I need to know how I can move hidden folders because I have a script that backs up my svn projects everyday and I have 2 backup folders "Today" and "Yesterday". It is like this:

Quote:
#!/bin/sh
date > begin.txt #this is just to know how long it takes
rm -r /network/ftp-backup/svnbackup/Yesterday/*
mv /network/ftp-backup/svnbackup/Today/* /network/ftp-backup/svnbackup/Yesterday/ #the problem is here because I can't mv the hidden folders (those with the ".") and then when I do the line in red, I get one folder per day per which hidden folder...and thats a lot of data and in case something happens to the today folders I lose the backup of my hidden folder and they are very important

ls -a /esp-server/svn/ > list.txt
cat list.txt | while read x; do
svn-hot-backup /esp-server/svn/$x /network/ftp-backup/svnbackup/Today
wait
done
wait
date > end.txt
Thanks a lot
# 2  
Old 11-12-2009
if you're looking how to get something moved which holds a . and more than one extra character use the ? to indicate it ie:
Code:
mv /network/ftp-backup/svnbackup/Today/.??* /network/ftp-backup/svnbackup/Yesterday

This way it will take ".[a-z|0-9|etc][a-z|0-9|etc]" avoiding the dreaded '..'
# 3  
Old 11-12-2009
oh man! I luve thiz forum...Thanks a lot
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rsync - how to copy hidden folder or hidden files when using full path

Hello. I use this command : rsync -av --include=".*" --dry-run "$A_FULL_PATH_S" "$A_FULL_PATH_D"The data comes from the output of a find command. And no full source directories are in use, only some files. Source example... (2 Replies)
Discussion started by: jcdole
2 Replies

2. Shell Programming and Scripting

Count hidden folders

I am newbies and struggling with this tasks. How to calculate only visible or hidden folders and files in a dictionary? ( i did something like this but it show both visible and hidden files at the same time: ls -l | grep ^- | wc -l ) how to use parse the output of an ls in order to find the... (3 Replies)
Discussion started by: vietanhxienbot
3 Replies

3. Shell Programming and Scripting

Copy between two different folders containing same sub-folders

I have a folder like this ls input1 dir1 dir2 dir3 file1 file2 file3 dir1, dir2 and dir3 are sub-folders inside the folder input1 ls input2 dir1 dir2 dir3 file1 file2 file3 My dir1 in input1 folder has files f1, f2, f3 and f4. My dir1 in input2 folder has file f4 and f5. ... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

4. UNIX for Dummies Questions & Answers

List all directories hidden or not hidden

I want to list all directories hidden or not hidden. ls -ld */ => shows only not hidden directories so i guess the answer would be to add the a option to show all files ls -lad */ => not working :confused: ls -la | grep "^d" => works But I would like to know why I can't use ls -lad... (4 Replies)
Discussion started by: servus
4 Replies

5. UNIX for Dummies Questions & Answers

Searching for folders/parent folders not files.

Hello again, A little while back I got help with creating a command to search all directories and sub directories for files from daystart of day x. I'm wondering if there is a command that I've overlooked that may be able to search for / write folder names to an output file which ideally... (2 Replies)
Discussion started by: Aussiemick
2 Replies

6. Shell Programming and Scripting

Making 99 folders 99 folders deep

I am trying to make a unix shell script that will make 99 folders 99 deep (counting the first level folders). So far i have made it make the first 99 folders and 99 more in all of the folders. The only problem is the only way i have found is copying and pasting part of the script over and over and... (18 Replies)
Discussion started by: YukonAppleGeek
18 Replies

7. Shell Programming and Scripting

Finding Hidden files and protecting the folder containing hidden files from deletion

Hi. I have a script which is deleting files with a particular extension and older than 45 days.The code is: find <path> -name "<filename_pattern>" -mtime +45 -exec rm {} \; But the problem is that some important files are also getting deleted.To prevent this I have decide to make a dummy... (4 Replies)
Discussion started by: pochaw
4 Replies

8. UNIX for Dummies Questions & Answers

Copying Folders without some folders... ;-)

I am in a fix....... I have to write a backup script to backup say Folder A. Folder A contains n folders 1,2 ,3 .....n. my script should copy A without folder 2 & 3. Is there anyway I can do it without writing individual copy commands???? Please help.... (5 Replies)
Discussion started by: chimpu
5 Replies

9. Shell Programming and Scripting

Backing up Folders without some folders...;)

I am in a fix....... I have to write a backup script to backup say Folder A. Folder A contains n folders 1,2 ,3 .....n. my script should copy A without folder 2 & 3. Is there anyway I can do it without writing individual copy commands???? Please help.... (1 Reply)
Discussion started by: chimpu
1 Replies
Login or Register to Ask a Question