简体   繁体   中英

Run jarfile on ftp without downloading

I have executable jar file which i have kept on my ftp.

I wanted to autoschedule it through linux server - cronjob.

I given the command :

java -jar filepath.jar

But when call goes to that file, it always asks for download, and after getting downloaded, it does not run automatically.

I want it to run automatically on the same server on which it is present (on ftp).

which command i can use for it??

Please help.

You could put something like this in your crontab :

ssh user@host 'java -jar filepath.jar'

and previously exchanging public keys between client and server so you won't be asked for the password

FTP is file transfer protocol. It cannot be used to execute programs. You have to use ssh, if that is possible.

Yes, use ssh to login into remote PC or server , That can be done using command "ssh username@IP Address of remote pc" on terminal.

By this way u can login in into remote pc and u will get the terminal of that PC inside your terminal. Now u can browse the files in that PC and simply execute any file u want without downloading.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM