/* DESC: This transfers a techsupport to a remote FTP server * Copyright (C) 2014 NetModule AG, Switzerland */ FTP_SERVER = "192.168.1.254"; FTP_USER = "user"; FTP_PASS = "password"; now = localtime(time()); timestamp = strftime("%Y%m%d%H%M%S", now); url = sprintf("ftp://%s/techsupport-%s.zip", FTP_SERVER, timestamp); nb_syslog("uploading techsupport to %s", url); rc = nb_transfer_put(FTP_USER, FTP_PASS, url, "/host/various/techsupport"); if (rc != 0) { nb_syslog("FAILED to upload techsupport"); exit(1); } nb_syslog("techsupport has been uploaded successfully"); exit(0);