[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Automatic process: What's the problem?



    Date: Mon, 9 Nov 1992 13:05 EST
    From: jiang@lia.di.epfl.ch (Tao JIANG)

    I have defined an automatic process to copy the user files from one
    Symbolics machine to another.  I use this as an alternative to the
    tape backup.


      (defun backup-all-user-files ()
	(cp:execute-command "copy file"
			    "dave:>jiang>**>*.*.newest" "dom:>users>jiang>**>*.*.*"
			    :create-directories :yes
			    :output-destination (list #p"dom:>backup-log.text")))

      (defun automatic-backup ()
	(si:add-timer-queue-entry
	 (list :absolute (time:parse-universal-time "20:00 today"))
	 (list :forever 86400)
	 "Automatic Backup" #'backup-all-user-files))


    But there is a problem: when the time is due, the machine says

	    "Automatic Backup Process wants to type out.
	     Select Automatic Backup Background Stream by typing Function-0-S."

The problem is your use of CP:EXECUTE-COMMAND.  It always does a
(fresh-line) before executing the command (it's intended for use by the
interactive command processor).  :OUTPUT-DESTINATION redirects the
output of the command, but not the output of the command processor.

Just call the SI:COM-COPY-FILE function directly, rather than going
through CP:EXECUTE-COMMAND:

(si:com-copy-file #p"dave:>jiang>**>*.*.newest" "dom:>users>jiang>**>*.*.*"
		  :create-directories :yes
		  :output-destination '(#p"dom:>backup-log.text"))

I figured this out by using "Debug Process Automatic Backup" and then
searching up the stack for the function that was performing output.

                                                barmar