this post was submitted on 23 Apr 2024
47 points (88.5% liked)

Linux

48193 readers
1115 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

https://codeberg.org/cyber-luna/lunas

Archlinux: yay -S lunas

i made a versatile syncing cli program, lunas, that's capable of syncing local to local, local to remote, remote to local and remote to remote at the same time with many input directories, with their file attributes if enabled and more. It syncs both ways but it has src/dest options that can be assigned to individual input directories

it runs locally, unless remote syncing is used then it runs peer-to-peer using libssh/sftp

It can do sync removal between different input directories, meaning if u want to remove a file/directory that you don't want to sync back to other directories, you can "lunas -rm file" for local or "lunas -rrm user@ip:/path/to/dir" for remote and then use the option "-cr Y" while syncing to remove it from every other directories, or simply don't use this option and it should be ignored without removal, or "-cr S" and it should be synced back to the directory it was removed from, IF it was found in one of the other directories

it has an optional config file for defining presets for easier syncing instead of writing them each time in the cli

there are more options to it which can be found in the --help or in the man page for more details

a simple usage of lunas can be like this

lunas -p dir1 -p dir2 --dry-run

lunas -s dir1 -d dir2 -d dir3 -rd user@ip:dir4

lunas -r user@ip:dir1 -d dir2 -dr

lunas -rs user@ip:dir1 -d dir2 -cr Y

lunas -rd user@ip:dir1 -s dir2

lunas -p dir1 -p dir2 -p dir3 -p user@ip:dir4 -p user@ip:dir5

p: local path r: remote path , both of them are source and destination

s: source local path d: destination local path

rs: source remote path rd: destination remote path

-dr/--dry-run: outputs what would be synced without actually syncing them

-cr/--confirm-remove Y: confirms the sync removal as explained previously

you are viewing a single comment's thread
view the rest of the comments
[–] vort3@lemmy.ml 30 points 6 months ago (9 children)

Is it trying to solve any problem that is not solved by rsync/rclone?

Don't get me wrong, I love new tools, just curious how is it different (better or worse) from rsync?

[–] cyberluna@programming.dev 10 points 6 months ago* (last edited 5 months ago) (8 children)

i'm not familiar with rclone. I'm kinda familiar with rsync, but not much so excuse me if i got something wrong,

3 main things that are in lunas but not in rsync

  • multi directory syncing with src and/or dest for each input directory

u can sync as many directories, locally and remotely, ig as your ram can handle

src input directories -> files are not synced to them, but they sync to other input directories

dest input directories -> files ARE synced to them, but they DON'T sync to other input directories

src+dest input directories -> they do both, files are synced to them, and from them to other input directories

lunas -p dir1 -p dir2 -p dir3 -p dir4 -p dir5 -r user@ip:dir6

all of these dirs should be the same at the end, since -p is src and dest at the same time, same for -r

  • config file -> which many presets could be defined and used very conveniently " lunas -c preset_name"

path : ~/.config/lunas/lunas.conf

global{

    resume = on  # resume file syncing if it was interrupted

   progress = on # show progress bar for file syncing

   update = on # check for file mtimes and resync them based on mtime difference. Newer to old

   mkdir = on # make input directories if not there

   compression = on # in remote transfer, zlib is used

}

cool{

   p = /path/to/dir

   r = user@ip:/path/to/dir

   verbose = on

   attributes = atime

}

command > lunas -c cool

using this command lunas would load what's in the preset named "cool", and tries to sync the paths inside them and enable the options. And there is >the special preset called "global" which can always run while using -c preset, or normally using the cli "lunas -p dir -p dir2" this basically lets the user >defined their default options that make sense for them instead of rewriting them in the cli each time

btw lunas can load multiple presets at once

lunas -c cool -c other_preset -c etc

  • sync removal -> to sync remove files from other directories

in case someone wanted to delete a directory or file and don't want them to be synced back to other backup directories for instance, or want them >removed, they could use sync removal. By default it acts as excluding, unless -cr Y is used, then it should remove them from other input directories, >if found

or --exclude can be used to exclude files without removing them, i'm thinking of maybe adding a .lunasignore file similar to .gitignore to make this >extra convenient

lunas doesn't have as many options as rsync, it still has many tho, u could take a quick look at both of them to compare if you want. But i'm still developing lunas and i wanna make it even more cooler, it's been like over 6 months since i started it, so hopefully more cool stuff come in the future

[–] vext01@lemmy.sdf.org 2 points 6 months ago (1 children)

multi directory syncing with src and/or dest for each input directory

So this is like "normal", "send only", "recieve only" folders in syncthing?

[–] cyberluna@programming.dev 1 points 6 months ago

I took a look at their docs https://docs.syncthing.net/v1.27.5/users/foldertypes

And it seems similar

Src/send-only -> send files to other dest/receive-only

Dest/recieve-only -> doesn't send any file modifications or new files to other directories

Src+dest/normal -> send files to other dest and receives files from other srcs

With the option -D/-diff enabled file modifications can be synced, with newer files replacing older files

load more comments (6 replies)
load more comments (6 replies)