LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-14-2018, 11:59 AM   #1
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Rep: Reputation: Disabled
Full File Sync


All,

Looking for a file sync program, hopefully git based, that can do:
  1. Add multiple duplicate directories to the repository,
  2. Test and eliminate/delete any 0Kb files in any of the directories loaded,
  3. Find all "like named" files, including File, File1, File2 as autonamed by Linux
  4. Do complete code comparisons before merger,
  5. Hold the file with newest date as the anchor/master file,
  6. Merge all changes from other "Like" files into the master file,
  7. Delete all non-master files, after merge to master,
  8. Hold non-mergable files in a separate repository for review,
  9. Has suggested merge files for non-mergable files, by code comparison,
  10. Has CRON based backup system for master and non-merged files.
  11. Use a graphical or browser interface to work the remaining non-mergable files.

I've not yet found and app that does this and read a lot of info. Understand git itself can do this, but not git savy, so not sure how to implement it. Have git installed!

Cheers!

TBNK

Last edited by TBotNik; 11-14-2018 at 12:03 PM.
 
Old 11-14-2018, 08:04 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,321
Blog Entries: 28

Rep: Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141
Would you list some of the programs you have decided not against, so that posters don't go back over ground you have already plowed?
 
2 members found this post helpful.
Old 11-15-2018, 06:05 AM   #3
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,485

Rep: Reputation: Disabled
Normally, rsync is used by most people & GUI programs.
 
2 members found this post helpful.
Old 11-15-2018, 12:16 PM   #4
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
fatmac,

From what I read RSYNC is only capable of half these features, but inform me if you see differntly.

Kinda wondering if I have to write a BASH script that gets all the directories and files then starts calling other apps like rsync to work the backend issues. To properly sync with versioning, a compare will have to be executed.

Oh! On my list of features I have to be able to:
  • Read and Extract compressed files also,
  • Sync to my own git repo and then to Dropboxes git repo,

Cheers!

TBNK

Last edited by TBotNik; 11-15-2018 at 05:26 PM.
 
Old 11-15-2018, 01:01 PM   #5
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Check out rsnapshot. Yes, uses rsync but is highly configurable and very flexible.
 
Old 02-20-2019, 07:27 PM   #6
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by fatmac View Post
Normally, rsync is used by most people & GUI programs.
fatmac,

I conceptually haven't a clue when I read the rsync docs and haven't found a "Rsync for Dummies" book yet!

TBNK
 
Old 02-20-2019, 07:29 PM   #7
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
All,

Seriously, because of so many ways to approach/do this and all totally confusing, conceptually, thinking about writing a "SyncMasters Bible" to show and explain, with examples of each method!

What do y'all think?

TBNK
 
Old 02-21-2019, 12:21 AM   #8
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
It would be both interesting and useful to many.
 
Old 02-25-2019, 06:20 AM   #9
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-15.0 / slarm64-current
Posts: 780
Blog Entries: 1

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
One funny thing about rsync flags are the flags that represent sequences of other flags, like -a (--archive) which is equivalent of -rlptgoD... so after trying heaps of options, I settled on good old -abcv, with an added -v for verbosity, lol. My rsync often look like
Code:
rsync -abc --exclude="nothispattern" --progress --suffix="$(date +%s) sourcepath/ targetpath
Usually one of the paths is on a network, and the -c flag only transfers files with different md5 checksums, which really saves bandwidth (which I still pay for by the GB)... Some network locations won't allow the -c flag, as it creates more work for their cpus, so I have to remove it in those situation.

The --suffix flag tells it to keep both files when there are duplicates with same name.

If I don't put the trailing slash on the source path, it makes a directory inside the target path, such that repeat syncs can create a directory inside a directory inside a directory ad infinitum.

These are not all of your features, however, I'm still an rsync novice--as pointed out, the man page is lengthy. Perhaps some of your other features are in there too.

Last edited by slac-in-the-box; 02-25-2019 at 06:21 AM. Reason: spelling
 
Old 03-27-2019, 10:05 PM   #10
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
All,

OK, my biggest problem is that Dropbox has gone south, it's been total crap now for over 5 years. It errors out, requiring a new install and it can not use a currently existing path of /../,,/,,/Dropbox, so writes a new /Dropbox folder somewhere else on your box, so now have over 20 copies of the #$$^&^%%$ thing.

So I'm not longer using DBox, so I have to find all copied files on my present box, I have to:
  1. Set a target folder/dir that I consider all the latest copies of the files,
  2. Run a script to find all the files and record them in the DB,
  3. Run another "diff" type script to determine which files are equal to the ones in the target dir,
  4. Delete the extra copies that are exactly "like" or "equal" to the one's in the target dir,
  5. Mark the deleted files in the DB, so they will be overlooked for additional processing,
  6. Run an additional "diff" type script to record the lines or records not equal and place in the DB,
  7. Merge the files if a document type,
  8. Update the DBs is the file is a DB type and records have been changed or added.
  9. Mark the completion dates, in the sync DB, when process is complete for the orginal file and it's dupes.
  10. Find all .sql files not existing in the target dir and move/copy them there, since this will be the actual data backup dir.
  11. Backup the entire updated set of DBs to a dated .tar.gz file, so we have the latest backup, since completing the sync,
  12. Repeat this sync process for all files and dirs on the Network attached machines (20).

So since MySQL and the other DBs are usually the hardest to backup and recover I started with all the backed up .sql files. Elsewhere in post:

http://www.linuxquestions.org/questi...nd-4175648313/

You'll see I was struggling with getting the /etc/updatedb.conf and the disk mounts to work correctly, to see all the /*.sql files. Finally got that working right, so have all the .sql files captured in /home/files/sql_dump.txt, which is over 4,000 files. Wrote the additional db_syncs.sql file to create the DB for recording these:

Code:
-- Database: `db_syncs`
# DROP Database IF EXISTS `db_syncs`;
CREATE Database IF NOT EXISTS `db_syncs`;
USE `db_syncs`;

DROP TABLE IF EXISTS `dh_files`;
CREATE TABLE `dh_files` (
	`fil_idx` INT(11) NOT NULL AUTO_INCREMENT	COMMENT 'Unique Cat Key',
	`fil_sfx` INT(11) NOT NULL 					COMMENT 'Xref to SameFile',
	`fil_pth` VARCHAR(255) NOT NULL				COMMENT 'File Path',
	`fil_bnm` VARCHAR(125) NOT NULL				COMMENT 'File BaseName',
	`fil_nam` VARCHAR(125) NOT NULL				COMMENT 'File Name',
	`fil_ext` VARCHAR(12) NOT NULL				COMMENT 'File Ext',
	`fil_org` ENUM('Y','N') DEFAILT 'N'			COMMENT 'File From Org Dir',
	`fil_eql` ENUM('Y','N') DEFAILT 'N'			COMMENT 'File Equal to Org File',
	`fil_ddt` datetime								COMMENT 'Delete Date',
	`fil_cdt` datetime								COMMENT 'Create Date',
	`fil_mdt` datetime								COMMENT 'Modify Date',
    PRIMARY KEY (`fil_idx`));

DROP TABLE IF EXISTS `dh_same`;
CREATE TABLE `dh_same` (
	`sam_idx` INT(11) NOT NULL AUTO_INCREMENT	COMMENT 'Unique Match Key',
	`sam_fdx` INT(11) NOT NULL 					COMMENT 'Xref to New File',
	`sam_pdx` INT(11) NOT NULL 					COMMENT 'Xref to Org File',
	`sam_nam` VARCHAR(255) NOT NULL				COMMENT 'File Name',
	`sam_cdt` datetime NOT NULL					COMMENT 'Create Date',
	`sam_mdt` datetime NOT NULL					COMMENT 'Modify Date',
    PRIMARY KEY (`sam_idx`));
Sure I will have to add to this DB as I go along and learn what else I need. 2nd table is the one where "Same File" by filename are recorded.

So now writing a PHP script to run the process. I do over 90% of my coding in PHP, but will also want to create a BASH version for those of you challenged in PHP.

Running my script I ran into errors, which I posted at:

https://www.linuxquestions.org/quest...23#post5978623

Cheers!

TBNK

PS
I dumped DBox for these 3 reasons:
  1. They could/would not fix their original problem that was causing all the duplicate folders,
  2. They refuse to support me in attempting to fix/merge the duplicates into one true updated version,
  3. From all the users I support and signup with DBox, I had 1.4TB of "FREE" space, but they now want $$ for it.

Cheers!

Last edited by TBotNik; 03-27-2019 at 10:12 PM.
 
Old 12-11-2019, 10:38 AM   #11
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
All,

Finally decided to use "git merge-file" to accomplish elimination of the dupes, but try as I might, I can not get the cmd line string in the right format to actually make it work!

TBNK
 
Old 01-02-2020, 02:14 PM   #12
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
Cn I get some help here?

Is there a GIT forum or a GIT help page on irc.freenode where I can get this fix?

TBNK

Last edited by TBotNik; 01-02-2020 at 02:18 PM.
 
Old 04-02-2020, 12:51 AM   #13
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by slac-in-the-box View Post
One funny thing about rsync flags are the flags that represent sequences of other flags, like -a (--archive) which is equivalent of -rlptgoD... so after trying heaps of options, I settled on good old -abcv, with an added -v for verbosity, lol. My rsync often look like
Code:
rsync -abc --exclude="nothispattern" --progress --suffix="$(date +%s) sourcepath/ targetpath
Usually one of the paths is on a network, and the -c flag only transfers files with different md5 checksums, which really saves bandwidth (which I still pay for by the GB)... Some network locations won't allow the -c flag, as it creates more work for their cpus, so I have to remove it in those situation.

The --suffix flag tells it to keep both files when there are duplicates with same name.

If I don't put the trailing slash on the source path, it makes a directory inside the target path, such that repeat syncs can create a directory inside a directory inside a directory ad infinitum.

These are not all of your features, however, I'm still an rsync novice--as pointed out, the man page is lengthy. Perhaps some of your other features are in there too.
slac-in-the-box,

Your comment made more sense than most, but being HEWBIE to the whole sync thing still GREEK to me. Hope you have patience with me and explain a little more!

Do you have a good "SETUP" HOWTO link to share?

Cheers!

TBNK

Last edited by TBotNik; 04-03-2020 at 02:55 PM.
 
Old 04-02-2020, 02:43 AM   #14
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
How much are we talking about?

'Meld' might be a helpful tool for manual sorting.
It can compare/merge dir's as well as files.
 
Old 04-02-2020, 03:26 PM   #15
Hermani
Member
 
Registered: Apr 2018
Location: Delden, NL
Distribution: Ubuntu
Posts: 261
Blog Entries: 3

Rep: Reputation: 113Reputation: 113
Why don't you check out FreeFileSync at https://freefilesync.org/

Have been using this program with a lot of success and (more important) zero failure. I think it can do most if not all you require.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
A table that Percona Toolkit "pt-sync" won't sync? sundialsvcs Linux - Server 0 10-21-2017 08:03 PM
[SOLVED] Gentoo: all mirrors out-of-sync? (e.g. dist files not found after "emerge --sync") Pearlseattle Gentoo 1 09-25-2014 01:49 PM
RAID1: Urgent.. Two disks out of sync... how to get them back in sync? tkalfaoglu Linux - Server 1 10-18-2013 03:42 AM
LXer: BitTorrent Sync: Automatically sync files on your Linux Devices LXer Syndicated Linux News 0 10-04-2013 03:50 PM
Sync for Samsung Sync master Naphoon Linux - Hardware 1 10-16-2004 06:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration