08-23-2012
jim mcnamara has got it.
You are sometimes picking up nascent files just after they have been created and before they contain data (hence the strange permissions). You could equally have been picking up part-written files which have the correct permissions. This situation tends to worsen with time once the directory file becomes fragmented.
We would suggest building a simple processing delay into the script by using the find command to only process files which are say at least one minute old (or more than the longest time that it takes to create a complete file - whichever is the greater). You can use find to check individual files.
The normal approach is to always use temporary file names when creating or copying a file, then rename the file to it's correct name when the process completes.
This User Gave Thanks to methyl For This Post:
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
i'm a relative newbie to unix (i'm on OSX) and i have a specific problem i'm tripped up on:
i'm piping the output of top (in log format) into an awk command which formats the information (and eventually will send it out continuously via udp/osc to another app). my problem is with what comes up... (4 Replies)
Discussion started by: ohhmyhead
4 Replies
2. UNIX for Advanced & Expert Users
I'm wrting a program which needs to get the following information of a sever by calling some lib fuctions or system calls, so can anybody help to tell me those function names or where I can find the description of them ?
CPU usage
Memory usage
Load procs per min
Swap usage
Page I/O
Net I/O... (1 Reply)
Discussion started by: xbjxbj
1 Replies
3. Programming
I'm wrting a program which needs to get the following information of a sever by calling some lib fuctions or system calls, so can anybody help to tell me those function names or where I can find the description of them ?
CPU usage
Memory usage
Load procs per min
Swap usage
Page I/O
... (11 Replies)
Discussion started by: xbjxbj
11 Replies
4. Solaris
Helllo folks...
I tryed to edit crontab and I have this problem when I do crontab -l it shows my crontab correctly and if I do crontab -e I get this.
baafh-99.03#
baafh-99.03# crontab -e
1063
?
?
?
?
?
and that is all ...:( I have to type "q" and hit enter and I am back... (4 Replies)
Discussion started by: amon
4 Replies
5. Shell Programming and Scripting
is there anyway to make while run a command faster than per second?
timed=60
while
do
command
sleep 1
done
i need something that can run a script for me more than one time in one second. can someone help me out here? (3 Replies)
Discussion started by: Terrible
3 Replies
6. Programming
I'm making a program that you input the month and year, and it creates a calender for that month of that year. This is my largest project yet, and I broke it up into several source files.
cal.c
#include "cal.h"
#include <stdio.h>
main() {
int month, year;
scanf("%d %d", &month,... (3 Replies)
Discussion started by: Octal
3 Replies
7. UNIX for Advanced & Expert Users
This is an unusual situation where I have an NFS server currently serving out MULTIPLE clients over several variants of Linux and UNIX successfully (world permissions) except for a SINGLE client. Even the other Linux (SuSE) clients in the same room are mounting successfully with defaults without... (6 Replies)
Discussion started by: neelpert1
6 Replies
8. Shell Programming and Scripting
what is wrong with the below script:
---------------------------------------------------------------------------------
#!/bin/bash
echo "Setting JrePath..."
grep -w "export JrePath" /etc/profile
Export_Status=$?
if
echo "JrePath declared"
elif
echo "JrePath not declared"
echo... (4 Replies)
Discussion started by: proactiveaditya
4 Replies
9. HP-UX
Our comp-operator has come across a peculiar ‘feature'. We have this directory where we save all the reports that were generated for a particular department for only one calendar year. Currently there are 45,869 files. When the operator tried to backup that drive it started to print a flie-listing... (3 Replies)
Discussion started by: vslewis
3 Replies
LEARN ABOUT SUSE
virt-copy-in
virt-copy-in(1) Virtualization Support virt-copy-in(1)
NAME
virt-copy-in - Copy files and directories into a virtual machine disk image.
SYNOPSIS
virt-copy-in -a disk.img file|dir [file|dir ...] /destination
virt-copy-in -d domain file|dir [file|dir ...] /destination
WARNING
Using "virt-copy-in" on live virtual machines can be dangerous, potentially causing disk corruption. The virtual machine must be shut down
before you use this command.
DESCRIPTION
"virt-copy-in" copies files and directories from the local disk into a virtual machine disk image or named libvirt domain.
You can give one of more filenames and directories on the command line. Directories are copied in recursively. The final parameter must
be the destination directory in the disk image which must be an absolute path starting with a "/" character.
EXAMPLES
Update "/etc/resolv.conf" in a guest:
virt-copy-in -d MyGuest resolv.conf /etc
Upload a home directory to a guest:
virt-copy-in -d MyGuest skel /home
JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH
This command is just a simple shell script wrapper around the guestfish(1) "copy-in" command. For anything more complex than a trivial
copy, you are probably better off using guestfish directly.
OPTIONS
Since the shell script just passes options straight to guestfish, read guestfish(1) to see the full list of options.
SEE ALSO
guestfish(1), virt-cat(1), virt-copy-out(1), virt-edit(1), virt-tar-in(1), virt-tar-out(1), <http://libguestfs.org/>.
AUTHORS
Richard W.M. Jones ("rjones at redhat dot com")
COPYRIGHT
Copyright (C) 2011 Red Hat Inc. <http://libguestfs.org/>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
libguestfs-1.18.1 2013-12-07 virt-copy-in(1)