A tool to help sync items in your local and remove server, pushing only modifications just like rsync
You can ignore files and folders by creating a .xsyncignore
file in the base directory similar way you'd write a .gitignore
file
To sync a file or directory to a remote server
```rs use std:: path::Path; use rxsync::{connection::SshCred, sync, connection::AuthOption};
//multiple auth options include //Attempt basic password authentication. let auth1= AuthOption::UserauthPassword("sshusername".tostring(), "sshpassword".tostring()); //authenticate the current connection with the first public key found in an SSH agent let auth2= AuthOption::UserauthAgent("sshusername".tostring()); //Attempt public key authentication using a PEM encoded private key file stored on disk let auth3= AuthOption::UserauthPubkeyFile("sshusername".tostring(), Some(&Path::new("pubkey")), &Path::new("privatekey"), Some("passphrase"));
let conn =SshCred::new( auth1, "host".tostring(), "port".tostring(), );
sync(&conn, &Path::new("sourcepath/"), Some(Path::new("dirpath"))).unwrap(); ```
This creates a .xsync.toml
file in the base directory which is a snapshot of the latest synced files and directories on the server
This file is how xsync can track what files or dir to update, delete or upload
To clone a directory or file
```rs use std:: path::Path; use rxsync::{connection::SshCred, clonedir, clonefile, connection::AuthOption};
let auth= AuthOption::UserauthAgent("sshusername".tostring()); let conn =SshCred::new( auth, "host".tostring(), "port".tostring(), );
clonedir(&conn, &Path::new("dirtoclone"), &Path::new("writedest")).unwrap();
//configdest is the destination you wish to write your .xsync.toml file which is optional clonefile(&conn, &Path::new("filetoclone"), &Path::new("writedest"), Some(&Path::new("configdest"))).unwrap();
``````