Last active
August 29, 2015 14:03
-
-
Save bararchy/78bcb57d9c3175461569 to your computer and use it in GitHub Desktop.
Testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Process.spawn do | |
Dir.mktmpdir do |temp_dir| | |
driver = Driver.new(temp_dir) | |
%x(sudo mv backup* #{temp_dir}) | |
print "\nDone, the backup archive has been created at #{temp_dir}/backup#{Time.now.strftime('%Y%m%d-%H%M')}.tar.gz" | |
server = Ftpd::FtpServer.new(driver) | |
get_ip | |
server.interface = @localip | |
server.start | |
puts "\nFTP server listening on port #{server.bound_port}, Press enter to close the FTP server\n" | |
gets | |
ftpid = Process.pid | |
%x(sudo kill -2 #{ftpid}) | |
exit 0 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment