LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-28-2023, 11:29 PM   #16
tuxthegreat
Member
 
Registered: Mar 2018
Distribution: Ubuntu Mate, OSX, Win10, ODROID-N2+
Posts: 180

Original Poster
Rep: Reputation: Disabled
Arrow


Quote:
Originally Posted by jmgibson1981 View Post
Not trying to be an ass but this needs to be said.



Google. Seriously. It got me switched from cron > systemd timers fairly quickly. It's surprisingly easy thing to get hold of. Once you have a template just modify it as needed. I have made several services with varying times using the first timer file I made as a template. Search systemd timers
I duckduckgo but I will for sure take you up on your advice and search and search some more, you've given me some homework it seems
 
Old 10-29-2023, 07:48 AM   #17
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,628

Rep: Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557

Stop doing "rm -r backupdir" followed by "cp -R sourcedir backupdir" and instead use rsync with --delete (and whatever other options are needed), and then:

1) you don't need to deal with two tasks.
2) you're not wasting time deleting files that are about to get re-created.

 
1 members found this post helpful.
Old 10-29-2023, 02:32 PM   #18
tuxthegreat
Member
 
Registered: Mar 2018
Distribution: Ubuntu Mate, OSX, Win10, ODROID-N2+
Posts: 180

Original Poster
Rep: Reputation: Disabled
Arrow

Quote:
Originally Posted by boughtonp View Post
Stop doing "rm -r backupdir" followed by "cp -R sourcedir backupdir" and instead use rsync with --delete (and whatever other options are needed), and then:

1) you don't need to deal with two tasks.
2) you're not wasting time deleting files that are about to get re-created.

Ok let's see if I got this right is it ?
Code:
rsync --delete-after /home/tuxthegreat/.config/transmission /media/tuxthegreat/Backup/transmission
or is it
Code:
rsync --delete-before /home/tuxthegreat/.config/transmission /media/tuxthegreat/Backup/transmission
Which one is it , is it the --delete-after or --delete-before switch ? And also did I even get the right commands ? This is the first time I am using rsync and I don't want to end up deleting the source directory, rather I want to delete the directory in /media/tuxthegreat/Backup/transmission so it can replace the dir from thesource dir? AM I in the right track guys ?
 
Old 10-29-2023, 03:00 PM   #19
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,832

Rep: Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219
Well, you did a rm -r first.
That speaks for --delete-before

Or just --delete if it doesn't matter when to delete the extraneous files.
 
1 members found this post helpful.
Old 10-29-2023, 04:08 PM   #20
tuxthegreat
Member
 
Registered: Mar 2018
Distribution: Ubuntu Mate, OSX, Win10, ODROID-N2+
Posts: 180

Original Poster
Rep: Reputation: Disabled
Angry

Quote:
Originally Posted by MadeInGermany View Post
Well, you did a rm -r first.
That speaks for --delete-before

Or just --delete if it doesn't matter when to delete the extraneous files.
So the proper command is ????
Code:
rsync rm -R --delete-before /home/tuxthegreat/.config/transmission /media/tuxthegreat/Backup/transmission
?? This is too confusing, I think I will stick to my 2 simple cron job commands guys. Sorry to have waisted your time.

Last edited by tuxthegreat; 10-29-2023 at 06:06 PM.
 
Old 10-30-2023, 08:29 AM   #21
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,628

Rep: Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557

...

Which part of my post suggests using --delete-after or --delete-before ?

As MadeInGermany said, the latter is closer to what you're doing already, but it is unnecessary unless space is limited. (If space is limited, get a bigger backup device.)

If you're unfamiliar with rsync, read the example usage. As you'll see, the -a (--archive) option is used frequently, as is -v (--verbose), and - as with any destructive action - doing a dry-run is a really good idea.

Quote:
Originally Posted by man rsync
--dry-run, -n
This makes rsync perform a trial run that doesn't make any changes (and produces mostly the same output as a real run). It is most commonly used in combination with the --verbose (-v) and/or --itemize-changes (-i) options to see what an rsync command is going to do before one actually runs it.
Additionally, creating a copy of the destination folder and testing independently (whilst keeping your existing tasks in place) might make sense.

 
1 members found this post helpful.
Old 10-31-2023, 10:18 AM   #22
tuxthegreat
Member
 
Registered: Mar 2018
Distribution: Ubuntu Mate, OSX, Win10, ODROID-N2+
Posts: 180

Original Poster
Rep: Reputation: Disabled
Arrow

Quote:
Originally Posted by boughtonp View Post
...

Which part of my post suggests using --delete-after or --delete-before ?

As MadeInGermany said, the latter is closer to what you're doing already, but it is unnecessary unless space is limited. (If space is limited, get a bigger backup device.)

If you're unfamiliar with rsync, read the example usage. As you'll see, the -a (--archive) option is used frequently, as is -v (--verbose), and - as with any destructive action - doing a dry-run is a really good idea.



Additionally, creating a copy of the destination folder and testing independently (whilst keeping your existing tasks in place) might make sense.

Ok I understand where you are going with this, I need to man rsync and start reading up on it. Rome wasn't built in a day and neither will my Debian 12. I have plenty of storge space, 200TB in raid6 and counting for my movie and music collection but that's another thread. I will look into rsync and I will post back my results on what I have learned, I wll mark this thread as Solved for the time being but I will post my results on it in case you are still interested in what if anything I have accomplished. So thank you for your time and patience, I know it is a virtue that is needed when it comes to me and Linux Anyway back to the drawing board. Wish me luck.
 
Old 11-25-2023, 05:24 AM   #23
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,832

Rep: Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219
(deleted)
 
Old 11-25-2023, 07:06 AM   #24
tuxthegreat
Member
 
Registered: Mar 2018
Distribution: Ubuntu Mate, OSX, Win10, ODROID-N2+
Posts: 180

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by MadeInGermany View Post
(deleted)
But if systemd is going to replace or *absorb* some of the traditional services what's there to stop it from going all the way and being number one ?
 
Old 11-25-2023, 08:54 AM   #25
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,832

Rep: Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219
As a user you can chose a distro that avoids systemd - like Devuan.
Other distros, other policies.
E.g. RedHat(and CentOS,Rocky,Alma) goes for systemd but still prefers chrony to systemd-timesyncd and nmcli/nmtui to systemd-networkd.
 
Old 11-25-2023, 09:12 AM   #26
tuxthegreat
Member
 
Registered: Mar 2018
Distribution: Ubuntu Mate, OSX, Win10, ODROID-N2+
Posts: 180

Original Poster
Rep: Reputation: Disabled
Lightbulb

Quote:
Originally Posted by MadeInGermany View Post
As a user you can chose a distro that avoids systemd - like Devuan.
Other distros, other policies.
E.g. RedHat(and CentOS,Rocky,Alma) goes for systemd but still prefers chrony to systemd-timesyncd and nmcli/nmtui to systemd-networkd.
Actually recently I got some free time saved up ( a couple of weeks ) and I have decided to bite the bullet and make my own *distro* and I will start with LFS *Linux From Scratch* I will start off with a stage 3 tarball and see where it takes me from there. I have 100% complete control over what goes where and I can avoid systemd altogether. What do you think @MadeInGermany, do you think that it would be a wise move and how hard do you think this venture would be for someone who has been using Linux from Ubuntu 6.06LTS, I know how to compile a kernel, how to add modules to it, I know how to compile my own software with some success. And I have more than one computers around me so I can prepare the LFS on one computer while I DDG answers on another one and bug you guys if it comes to that. I don't need some sophisticated workstation, I need it to have 2 browsers, Firefox and a second one, perhaps konqueror browser, see this shows the direction I am headed in, a KDE build, how hard would that be compared to a LFS Mate desktop ? Any pointers are welcome, I am just so sick of these issues that pop up that I have to ask help for because I didn't compile it so I don't know the inner workings for the software in question. I want to keep it KISS ( keep it stupid simple ) I also need a music player that plays FLAC cause I have a huge collection of FLAC music, I need it to have a Kodi media center and I need it to be able to mount inner HDDs cause I have a lot of those in m oversized tower. The computer in my signature is not the one I will be building the LFS on, I will be building it on another i9 9900KS rig that has a Nvidia card. So what do you think, go or no go ? I can always try and give up if it gets too hard, but I am a stubborn man who doesn't give up the second something doesn't go his way.
 
  


Reply

Tags
crondaily



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
[SOLVED] Welcome to emergency mode! After logging in, type "journalctl -xb" to view system logs, "systemctl reboot" to reboot, "systemctl default" or grounddolphin Linux - Newbie 11 06-09-2023 05:34 PM
systemctl status postgresql-tst.service starts the service if service is stopped MarianForums Linux - Newbie 7 11-03-2018 03:02 PM
Restart systemctl*daemon​ - systemctl command not found cjosephl Linux - Newbie 7 11-11-2017 04:53 PM
Job for vncserver@:1.service failed. See 'systemctl status vncserver@:1.service' and anis123 Linux - Server 0 09-16-2015 08:44 AM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:30 PM.

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