Your message dated Sun, 5 Dec 2010 17:53:01 -0700
with message-id <[email protected]>
and subject line Re: Bug#605832: /bin/mv: Issue with "mv: inter-device move
failed: "
has caused the Debian Bug report #605832,
regarding /bin/mv: Issue with "mv: inter-device move failed: "
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
605832: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=605832
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: coreutils
Version: 8.5-1
Severity: normal
File: /bin/mv
[CODE]mv PDF /home/gerard/
mv: inter-device move failed: `PDF' to `/home/gerard/PDF'; unable to remove
target: Is a directory[/CODE]
I did ls -ltra and visibly there is no LN link file going on ... I still do not
understand what is about this issue
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages coreutils depends on:
ii libacl1 2.2.49-4 Access control list shared library
ii libattr1 1:2.4.44-2 Extended attribute shared library
ii libc6 2.11.2-7 Embedded GNU C Library: Shared lib
ii libselinux1 2.0.96-1 SELinux runtime shared libraries
coreutils recommends no packages.
coreutils suggests no packages.
-- no debconf information
--- End Message ---
--- Begin Message ---
French Noob wrote:
> I am working on a sort of extension to mv:
>
> echo "Enhancement to mv program"
> if [ -d "$1" ] && [ ! -d "$2" ] ; then
> echo "Creating folder $2" ; mkdir -p "$2"
> fi
>
> if [ -d "$1" ] ; then
> FOLDER=`basename "$1"`
> var="$2" ; lastchar="${var##${var%%?}}"
> if [ "$lastchar" = "/" ] ; then
> TARGET="$2$FOLDER"
> else
> TARGET="$2/$FOLDER"
> fi
In that little snippet I would use a shell case match here.
case $2 in
*/) TARGET="$2$FOLDER" ;;
*) TARGET="$2/$FOLDER" ;;
esac
> echo "Moving folder $1 to $TARGET"
> [ ! -d "$2" ] && mkdir -p "$2"
You have put several lines into making directories. But this isn't
needed. Just let rsync do it for you.
> rsync -avPr --ignore-existing --remove-source-files "$1" "$2"
> else
> TARGET="$2"
> echo "Moving file $1 to $TARGET"
> rsync -avPr --ignore-existing --remove-source-files "$1" "$TARGET"
> fi
>
> However it is not perfeclty working... since it moves wrongly the content of
> folder or create a newer one.
>
> the right way would be :
> movemerge /path/sourcefolder /path2/targetfolder
> and one gets: /path2/targetfolder/sourcefolder
>
> well not working ... yet. I hope I can make it;
With rsync I always use the rule that the destination is always a
directory ending with a slash. That way is deterministic. The source
then always ends up in the destination in an expected way. I avoid
other cases such as source to destination where the destination is
named. That way behaves differently depending upon whether a
destination already exists or not. And also because the other cases
are not consistent with the legacy rcp and scp commands and the
differences annoy me.
This is drifting pretty far from the initial report of a bug in mv. I
think it has been established that it isn't a bug in mv even if it is
a limitation. I am going to go ahead and close this bug report now to
keep things tidy. But this does not mean that discussion should end.
Let's move the discussion of developing your script over to the
[email protected] mailing list. That would be a good
place for talking about how to do things and perhaps doing things in
different ways. There are a lot of knowledgeable people there and the
problem will be too much advice rather than too little. :-)
If you are wishing to talk specifically about cp or mv features then
the best mailing list is the upstream [email protected] mailing list.
That is an active mailing list and improving the behavior of mv across
devices would be appropriate there.
Bob
--- End Message ---