General :: Move Files In A Folder If It Is Not In Use?
Jun 24, 2011
In my bash script I need to move files in a folder if it is not in use.
Code:
for entry in `ls /root/shared_storage/input`; do
echo $entry
run=`lsof /root/shared_storage/input/$entry`
ru=${run:0:5}
echo $entry
if [ "$ru" == "" ]; then
........
It worked fine sometimes but sometimes it just get stuck at lsof. Is there any other way that I can use here to check if the $entry is using some other process?
View 10 Replies
ADVERTISEMENT
Jan 22, 2010
I`m totally new to linux, in fact I`m a windows adminscenario:I need to run a script that will automatically move 30 days old files from particular folder to a particular folder.
View 3 Replies
View Related
Jul 15, 2010
I'm trying to move font files (.ttf and .otf) from the download folder to a folder Inkscape can find them in. I tried dragging and dropping them in Dolphin but I don't have permission! So tried in the terminal:
Code:
~$ mv ~/downloads/fonts/*.*tf /usr/share/fonts
mv: cannot stat `/home/bryan/downloads/fonts/*.*tf': No such file or directory
As far as I can tell the directories exist.
View 14 Replies
View Related
Nov 16, 2010
Terribly new to Linux and find it mindboggling. I work on brain imaging and unfortunately all of the analysis runs on Linux, and I do not understand computers well coming as I do from a medical background. So my question - There are various folders of patient MRI scans (folders called P1, P2, P3 etc) and within them are enclosed certain files that I am interested in (always called the same name in all folders, say image001). I would like a script that enables me to copy and move this image001 in all these individual folders to another folder altogether.
View 13 Replies
View Related
Jun 11, 2010
I have a folderA that contains folderB that contains a lot of files. I would like to get rid of folderB, but not its contents. I want those contents to be inside of folderA. How can I accomplish this on the commandline?
View 2 Replies
View Related
Aug 20, 2010
I've got a folder called Foo. In foo, there are 20 folders called bar1, bar2, bar3,...,bar20. In each of those barXX folders there are 2 files. How can i move those 2 files up one level into Foo with one command?
View 9 Replies
View Related
Nov 20, 2010
I dual boot a computer from separate hard drives in Windows XP and Ubuntu 10.04. Here is the deal: On my windows drive I have a folder that is filled with folders inside folders packed full of files in all the folders. There is a 100% possibility that I have multiple copies of any file in multiple locations. Is there any nice command or program to move all the files in all the folders to one central folder and in any way get rid of the multiple copies? Also, how do I compare to files that may or may not have the same name, but otherwise be identical to see if they are identical?
View 9 Replies
View Related
Dec 7, 2010
I want to move a simple .rules file from a downloaded package which I have extracted to my homefolder, to the rules.d folder. So I open both Nautilus windows and drag it over, and I get the great "permission denied" error
View 1 Replies
View Related
Jan 10, 2011
I would like to know how to move all the files from a single folder and its subfolders to a single, different location in as few steps as possible. For example when I download files from one of my school's websites, the file I want is located in a deep sub-directory. So, I have to cd many times just to get to the file I want. Is there a way to recursively move all the files within a folder's subdirectories into a new location?
View 2 Replies
View Related
Nov 16, 2010
I have a script that checks a folder for zip files than moves them to a different folder. I want to check every 5 maybe 10 seconds and since cron is setup to run at least a 1 minute increment I'm not sure how to do that time check as probably a loop within the script. One other thing is once the time check is in the script how would a cron job be setup to run this script? Once the script is running cron doesn't need to run it again, is there a feature to check if it's running and if it's not then run it?
find /export/xxxshare -name "*.zip" -exec mv {} /export/store ;
View 3 Replies
View Related
Mar 12, 2010
Anyways, I recently got into the whole HTPC scene, and picked up an Acer Revo for my self, with a media center OS (XBMC) that was apparently modded from Ubuntu. Keep in mind that I can only use the terminal for any of this, as the GUI is just for video settings, etc.
So, XBMC just totally crashed on me, and the GUI stopped working. The files were still there, I just couldn't watch them. After many hours of tinkering, I decided to just reinstall XBMC, but make two partitions, and then move my movies and stuff to the new, working partition, and afterwards, delete the old, non working one.
I just don't know how to move from one partition to another.
So, can someone explain, in absolute layman terms, how to move my "Movies" folder from my first partition, to the New one?
View 4 Replies
View Related
Sep 14, 2010
When I position icons on the desktop in specific places, then I choose to move a file or folder into another folder, all the icons arrange back to the left side. This happened in an earlier version of KDE 4.x, disappeared the next version, and reappeared. how to keep this from happening. It makes using the desktop a pain in the you know what.
View 2 Replies
View Related
Dec 2, 2010
I'm running out of disk space in root, so I decide to move /usr/lib64 directory to other partition by creating moving the whole directory to new location and create a softlink in the old location. What I'm planning to do is:
1. Copy the whole directory to new location
2. Make sure if there's no problem in the copy process
3. Create a softlink in the old location pointing to the new location.
However, when I'm comparing the old location and the new location using du command, there's some discrepancies between those two where the new location contain bigger size than the old one. How is this possible?
Is this the proper way to save disk space by creating a softlink?
View 5 Replies
View Related
Mar 25, 2011
i want to move all files inside the folder moving to folder public_html which command i should use? m using centos5 64bit tell me full command which i should writer in ssh client..so my all files will be moved to public_html...from moving folder.
View 4 Replies
View Related
Apr 8, 2010
I m using sendmail. I have two queries regrding mailq
1) How i can move unwanted mails from mailq to diffrent folder?
2) How i can remove those mails from the mailq ?
View 3 Replies
View Related
May 7, 2010
I wrote this little script and I need some help, I am trying to achieve following:Every day I receive new file in the /home/denis/MyData/ folder and I don't know what the file mane will be but I want to move any file that arrives there to the new location /media/DataBackup/Linux/backup/ (media/DataBackup/ is external 500GB USB drive)to automatically create new folder with the date and time stamp every day and then to move content of the /home/denis/MyData/ into the new folder with current date stamp. So every day there will be new folder and will contain files for that day only.My script is as follows:
cd /media/DataBackup/Linux/backup/
mkdir MyData_$(date +%Y%b%d_%HH%MM)
#this creates file MyData_current date and time
[code]...
View 3 Replies
View Related
Feb 13, 2011
this is posable but am trying to do this "Create folder from a filename and move the file into the folder" i have 500000+ file's i need to do with is there a easy way?I really don't want to download them all make/move them with filemonkey just to re-upload them
View 2 Replies
View Related
Feb 24, 2011
I installed Ubuntu Maverick as a file within Windows XP. A folder was created called Ubuntu and two files called wubildr and wubildr.mbr appeared on my C-Drive. The Windows boot.ini file looks like this code...
The initial 8 GB I gave to Ubuntu is too small and I would like to move the file to my D-Drive and expand it to 40 GB.
I would hate to have to begin again from scratch. Is this possible? If so, how?
View 3 Replies
View Related
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
May 7, 2011
1. Every Sunday2. Find all files older than 1 day3. Gzip these file4. Tar up the gzipped files into one tar file.5. Name the tarball with a date stamp indicating what day it was created, so we know that week's files are in the file
View 3 Replies
View Related
Oct 3, 2010
Many years ago, I converted a portion of my files to an arbitrary format with a specific extension. i no longer desire to have them in this format and i would like begin the process of replacing them because conversion is not an appropriate solution. unfortunately, they are mixed in separate folders of the same root folder with files in my current format of a different extension. I feel it would make this process easier if I were to move every folder that contained a file with the undesired format to a separate root folder. The files are stored on a Linux server and shared via samba. How can I do this with a couple of commands or a script? I am open to other suggestions as well. I want to avoid time spent editing text files. Ultimately, I'd like a command that produced a list of full paths for folders, sorted by the number of levels would be a nice touch. A list of all of the files is clearly not what I'm looking for.
View 2 Replies
View Related
Nov 23, 2010
In Linux bash shell, for a given directory, how can I list:The create date for that directory The number of files in that directory The number of subdirectories in that directory.
View 3 Replies
View Related
Aug 18, 2009
Being relatively new both to Linux and this forum, i am sorry if i make a post that already is, evn though i couldn`t find it.My problem is i can`t move downloaded files over to root filesystem, i have downloaded and unpacked them to files. to change it`s looks and downloaded a skin, i open root, go to usr---> amsn ---> share --> skins, now i am to copy the file of the skin over to the root directory, butI also tried alt+f2, writing sudo conqueror, as an advice i got, but there was noe difference.
View 14 Replies
View Related
Dec 17, 2009
what I got - from a crontab run a script (understand that part), this script needs to count the amount of files in /outgoing/, then take 30 less that number, and move that many files from /readycalls/. I need to keep the asterisk outgoing que full of .call files with out having to many in there at any given time.
View 3 Replies
View Related
Sep 10, 2009
How would i go about copying all .jpg or .JPG files from a folder and all its subfolders to my /usr/name/pictures folder? I'm guessing I'd have to use some sort of .[jJ][pP][gG] to get all the pictures from other examples i've seen, but really not sure how to use that in a recursive cp.
View 14 Replies
View Related
Apr 29, 2011
I found a script that runs any commands from a dropbox folder. It seems to take the scripts i have from the remote folder to the output folder to the old folder. but it never seems to actually run the scripts. it just seems to move the scripts from folder to folder Here is the page of what I'm talking about. [URL]
View 6 Replies
View Related
Mar 4, 2010
i need to copy files from a folder called output files to another folder called running but im not able to do it i always get a stat error
View 14 Replies
View Related
Nov 3, 2010
I got a folder that I transfer stuff to all the time. the folder is in chmod 775 but when i upload folders and files, they are given chmod 700, but i want it chmod 775 everytime i upload something. so far i have logged in to my linux computer and did a chmod -R 775 to the folder every time i uploaded something to it. is there a function somewhere to make it 775 everytime i upload or can i have something run a script, so i don't have to go in and write it everytime i upload something?
View 2 Replies
View Related
Dec 1, 2010
I would like to move a folder to another folder but I just want to merge the two folders.
For example,
say I have Folder B which has the following files in it
- fileA
- fileB
- fileC
Folder A has the following files in it
- fileA
- fileB
- fileC
- fileD
- fileE
And I want to move folder A to folder B.
The objective here is to ensure that existing fileA, fileB and fileC are not replaced but fileD and fileE are to be copied across.
Is there an easier way to do this in linux?
I am running Ubuntu 10.04.
View 4 Replies
View Related
Sep 6, 2010
I have a directory with a bunch of scripts and other random files. I want to move the files with the executable flag set to another folder en masse (or, if it's easier, the ones without the x flag). Is there an easy way?
View 1 Replies
View Related