move files only copys files - why?

Here is my script to archive files from a one server to another. Works fine so far but the files are copied instead of moving - is this normal behaviour for the move command?

--SET THE ARCHIVE AND LIVE FOLDER PATH
set live to "apath" as alias
set archive to "apath" as alias
--GET YESTERDAY'S DATE
set d to (current date) - 1 * days
if day of d < 10 then
	set ydate to month of d & " 0" & day of d & " " & weekday of d as string
else
	set ydate to month of d & " " & day of d & " " & weekday of d as string
end if
--CREATE FOLDER AND MOVE FILES
tell application "Finder"
	--CREATE FOLDER WITH YESTERDAY'S DATE IN THE ARCHIVE
	set yarchive to make new folder at archive with properties {name:ydate}
	--MOVE LIVE FILES TO ARCHIVE
	move entire contents of live to yarchive
end tell

Model: XServe - Leopard 10.5.6
AppleScript: 2.0.1
Browser: Firefox 3.0.6 (.NET CLR 3.5.30729)
Operating System: Mac OS X (10.5)

Hi,

yes, the AppleScript command moves files and folders, if source and destination are on the same volume, otherwise it duplicates the files.
I recommend to use a shell method, it is faster and can create the target directory on-the-fly.


--SET THE ARCHIVE AND LIVE FOLDER PATH
set live to POSIX path of alias "apath"
set archive to POSIX path of alias "apath"
--GET YESTERDAY'S DATE
tell ((current date) - 1 * days) to set ydate to (its month as text) & space & text -2 thru -1 of ("0" & its day) & " " & its weekday
--CREATE FOLDER AND MOVE FILES
do shell script "/usr/bin/ditto " & quoted form of live & space & quoted form of (archive & ydate) --CREATE FOLDER WITH YESTERDAY'S DATE IN THE ARCHIVE AND MOVE THE CONTENTS
do shell script "/bin/rm -r " & quoted form of live --DELETE THE SOURCE FILES

thanks for that. a lot less lines of code than mine.

I have edited it a little bit to shorten the folder name which works fine

but if i try and implement your posix path I get an error that the volumes/apath is a directory. Well I know that it is a dir but why is this a problem?


–SET THE ARCHIVE AND LIVE FOLDER PATH TO A VARIABLE
set test to POSIX path of alias “path”
set archive to POSIX path of alias “avolume:afolder:afolder:”

–GET YESTERDAY’S DATE
tell ((current date) - 1 * days) to set ydate to text 1 thru 3 of (its month as text) & " " & text -2 thru -1 of (“0” & its day) & " " & text 1 thru 3 of (its weekday as text)

–CREATE FOLDER WITH YESTERDAY’S DATE IN THE ARCHIVE AND MOVE THE CONTENTS OF LIVE TO IT
–do shell script “usr/bin/ditto” & quoted form of test & " " & quoted form of (archive & ydate)
–do shell script “/bin/rm -f” & quoted form of test
do shell script quoted form of test & " " & quoted form of (archive & ydate)
do shell script “/bin/rm -f” & quoted form of test

in the first shell script line the command (ditto) is missing

i tried it with and without ditto?

without ditto nothing happens but an error.
With ditto there must be a space character after ditto (as in my script)

ok it was the space. thanks

I actually want to leave the live directory structure intact. Previously I would copy the directories to the archive, delete them from live and then recreate the folders. Is there a way of using find and rm to remove all files within a tree without deleting the tree?

nevermind, i did it by using

set t to files of enitre contents of folder as alias list
delete t