[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [12200] Move files to archive on remote server rather
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [12200] Move files to archive on remote server rather than delete |
Date: |
Fri, 17 Oct 2014 13:27:26 +0000 |
Revision: 12200
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12200
Author: sigurdne
Date: 2014-10-17 13:27:24 +0000 (Fri, 17 Oct 2014)
Log Message:
-----------
Move files to archive on remote server rather than delete
Modified Paths:
--------------
trunk/property/inc/cron/default/import_oppdatering_av_bestilling_fra_agresso_bkb.php
Modified:
trunk/property/inc/cron/default/import_oppdatering_av_bestilling_fra_agresso_bkb.php
===================================================================
---
trunk/property/inc/cron/default/import_oppdatering_av_bestilling_fra_agresso_bkb.php
2014-10-17 08:26:50 UTC (rev 12199)
+++
trunk/property/inc/cron/default/import_oppdatering_av_bestilling_fra_agresso_bkb.php
2014-10-17 13:27:24 UTC (rev 12200)
@@ -199,22 +199,16 @@
$file_remote = $file_name;
$file_local =
"{$directory_local}/{$file_name}";
- $fp = fopen($file_local, "wb");
-
- if ($this->debug)
+ if(ftp_get($connection,
$file_local, $file_remote, FTP_ASCII))
{
- _debug_array('debug
fopen(): ' . $fp);
- }
-
-
if(ftp_fget($connection,$fp,$file_remote,FTP_ASCII))
- {
- if(
ftp_delete($connection, $file_remote))
+
if(ftp_rename($connection, $file_remote, "arkiv/{$file_remote}"))
{
+ echo "File
remote: {$file_remote} was moved to archive: arkiv/{$file_remote}<br/>";
echo "File
remote: {$file_remote} was copied to local: $file_local<br/>";
}
else
{
- echo "ERROR!
File remote: {$file_remote} failed to move from remote:
{$directory_remote}/{$file_name}<br/>";
+ echo "ERROR!
File remote: {$file_remote} failed to move from remote:
{$directory_remote}/arkiv/{$file_name}<br/>";
if(unlink($file_local))
{
echo
"Lokal file was deleted: {$file_local}<br/>";
@@ -225,7 +219,6 @@
{
echo "Feiler på
ftp_fget()<br/>";
}
- fclose($fp);
}
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [12200] Move files to archive on remote server rather than delete,
Sigurd Nes <=