DevShivmohan / Learning-everything

Learning for developer only
0 stars 1 forks source link

Windows and Linux commands with cloude Server #20

Open DevShivmohan opened 2 years ago

DevShivmohan commented 2 years ago

Sending file through API via curl mode [for Windows and Linux both]

image

curl -X POST "http://139.59.56.154:8090/trf/security/send/file/data" -H "accept: */*" -H "Content-Type: multipart/form-data" -F "file=@Shiv.jpg;type=image/jpeg"

OR

curl -X POST "http://139.59.56.154:8090/trf/security/send/file/data" -H "accept: */*" -H "Content-Type: multipart/form-data" -F "file=@Shiv.jpg;"

Shiv.jpg file inside the current directory

DevShivmohan commented 2 years ago

MySQL dump using java [for Windows]

String[] pp = new String[]{"cmd.exe", "/c", "mysqldump --host=<host_name> --user <user_name> --password=<password> --opt <database_name> > <backup_file_name_with_sql_extension>"};
Runtime.getRuntime.exec(pp);

MySQL dump using java [for Linux]

String[] pp = new String[]{"sh", "-c", "mysqldump --host=<host_name> --user <user_name> --password=<password> --opt <database_name> > <backup_file_name_with_sql_extension>"};
Runtime.getRuntime.exec(pp);