Re: [PLUG] Move cron jobs to new computer

2023-10-03 Thread Rich Shepard

On Mon, 2 Oct 2023, John Jason Jordan wrote:


When I sat down at the computer this morning the gxmessage window was in
the middle of the screen announcing that rsync ran at 3am and at 4am to
make mirrors of / and ~/ with exit code 0. I had put a dummy file on both
partitions before going to bed, so I checked and it was in both mirrors.
Problem solved. Except that I still haven't figured out where cron saves
the files. At least now I have the sense to copy them to a text file in
~/.


John,

I, too, don't know where my system keeps my (and root's) crontabs. But, that
doesn't matter to me. The files I enter there are actually in either
~/shell-scripts/ (for my crontabs) or in /root for root's crontabs. I
suggest you use the same storage devices. These files are date-time
specific; for example, in my crontab I have:

# run postgres backup daily at 11:15 pm
#15 23 * * mon-fri /home/rshepard/shell-scripts/postgres-daily-backup.sh

# process spam-uncaught
10 2 * * sun /home/rshepard/shell-scripts/process-spam.sh

Some of root's crontab files are:
# dirvish backup each day at 00:30.
30 0 * * * /root/dirvish-backup.sh

# copy bkup1 to bkup2 each day at 01:00
0 1 * * * /root/copy-backup.sh

# postfix mail log report
45 3 * * * /usr/bin/pflogsumm.pl -d yesterday /var/log/maillog.1

HTH,

Rich







Re: [PLUG] Move cron jobs to new computer

2023-10-02 Thread John Jason Jordan
On Fri, 29 Sep 2023 16:22:47 -0700
John Jason Jordan  dijo:

>I'm just going to have to muddle through and rewrite them.

When I sat down at the computer this morning the gxmessage window
was in the middle of the screen announcing that rsync ran at 3am and at
4am to make mirrors of / and ~/ with exit code 0. I had put a dummy
file on both partitions before going to bed, so I checked and it was in
both mirrors. Problem solved. Except that I still haven't figured out
where cron saves the files. At least now I have the sense to copy them
to a text file in ~/.


Re: [PLUG] Move cron jobs to new computer

2023-09-30 Thread David Fleck
--- Original Message ---
On Friday, September 29th, 2023 at 6:22 PM, John Jason Jordan  
wrote:
> Names of what? I still haven't found where cron is storing the jobs.
> The cron man page is silent on the subject, and online I haven't found
> it mentioned yet. It's not /var/spool/cron; empty on both systems. And
> it's not in /etc/cron.d or any of the /etc/cron. folders, because
> all they have is the standard default folders and files, all with old
> timestamps.

Can you describe what you did to create the jobs in the first place?


--
David Fleck



Re: [PLUG] Move cron jobs to new computer

2023-09-29 Thread John Jason Jordan
On Fri, 29 Sep 2023 14:57:35 -0700 (PDT)
Rich Shepard  dijo:

>On Fri, 29 Sep 2023, John Jason Jordan wrote:
>
>> Well, that didn't come out well. In Xubuntu I did 'sudo crontab -e,'

>When you want to only look at the crontab contents use `crontab -l' to
>list them.

I did that as well, and as jjj and as root, and all I found was the T-
Mobile reminder.

>If you know the file names, or part of them you can do either `locate
>' or `sudo find / -name '.

Names of what? I still haven't found where cron is storing the jobs.
The cron man page is silent on the subject, and online I haven't found
it mentioned yet. It's not /var/spool/cron; empty on both systems. And
it's not in /etc/cron.d or any of the /etc/cron. folders, because
all they have is the standard default folders and files, all with old
timestamps.

Several GUI cron alternatives are mentioned on the net, but none seem
to be in the Debian or Xubuntu repositories. I also haven't found a cron
tutorial that is useful. I don't need instructions, I just need several
pages of examples that I can crib from. Web 'tutorials' mostly just copy
and paste man cron, which has zero examples.

I'm just going to have to muddle through and rewrite them.


Re: [PLUG] Move cron jobs to new computer

2023-09-29 Thread Rich Shepard

On Fri, 29 Sep 2023, John Jason Jordan wrote:


Well, that didn't come out well. In Xubuntu I did 'sudo crontab -e,'


John,

When you want to only look at the crontab contents use `crontab -l' to 
list them.



Sparky's crontab is empty, so I can paste in the T-Mobile job from
Xubuntu, but it looks like I'll have to rewrite the two backup jobs and
the job to pop up the rsync exit codes. The scripts are here and they run
fine when I run them manually. I remember writing these jobs in Xubuntu's
crontab a couple years ago. What happened to them? And if the jobs are no
longer in Xubuntru's crontab, why are they still running?


If you know the file names, or part of them you can do either `locate
' or `sudo find / -name '.

Regards,

Rich


Re: [PLUG] Move cron jobs to new computer

2023-09-29 Thread John Jason Jordan
>On Thu, 28 Sep 2023 20:58:41 -0700
>wes  dijo:
>
>>On Thu, Sep 28, 2023 at 6:21 PM John Jason Jordan 
>>wrote:
>>> >I don't know where those distros keep cron files.

>>they are kept in /var/spool/cron.
>>But, look first at  
>>these are different from crontab. each has its own strengths and
>>weaknesses.  

>There is a /var/spool/crontabs folder in Xubuntu's /, but it is empty.
>And I read about anacron and a couple more, but what I did before
>worked well. I have it on tomorrow's to-do list to reboot to Xubuntu,
>go to crontab -e, copy my jobs to a text file, and get back to Sparky.
>In theory that's all I need to do.

Well, that didn't come out well. In Xubuntu I did 'sudo crontab -e,'
and it had one small job: a monthly reminder to pay my T-Mobile bill,
The daily jobs to back up /home and / were nowhere to be seen. There was
also nothing in anacron. Yet, in Xubuntu /home and / were getting
backed up every night, and there was another daily cron job to pop up a
message with the date and rsync exit code. In Xubuntu every morning that
message was on the middle of my screen. But right now I have no idea
what was making the rsync scripts run in Xubuntu.

Sparky's crontab is empty, so I can paste in the T-Mobile job from
Xubuntu, but it looks like I'll have to rewrite the two backup jobs and
the job to pop up the rsync exit codes. The scripts are here and they
run fine when I run them manually. I remember writing these jobs in
Xubuntu's crontab a couple years ago. What happened to them? And if the
jobs are no longer in Xubuntru's crontab, why are they still running? 


Re: [PLUG] Move cron jobs to new computer

2023-09-28 Thread John Jason Jordan
On Thu, 28 Sep 2023 20:58:41 -0700
wes  dijo:

>On Thu, Sep 28, 2023 at 6:21 PM John Jason Jordan 
>wrote:
>
>>  
>> >I don't know where those distros keep cron files.  
>
>
>they are kept in /var/spool/cron.
>
>But, look first at
>> >/etc/; there should be a set of cron directories there; e.g.,
>> >cron.d/, cron.daily/, cron.hourly/, cron.monthly/, cron.weekly/.  
>>
>>  
>these are different from crontab. each has its own strengths and
>weaknesses.

There is a /var/spool/crontabs folder in Xubuntu's /, but it is empty.
And I read about anacron and a couple more, but what I did before
worked well. I have it on tomorrow's to-do list to reboot to Xubuntu,
go to crontab -e, copy my jobs to a text file, and get back to Sparky.
In theory that's all I need to do.

It's taken about a week, but I'm almost done. And I'm liking Sparky
more than Xubuntu. And there's nothing snapping at me or flat packages
to deal with.


Re: [PLUG] Move cron jobs to new computer

2023-09-28 Thread wes
On Thu, Sep 28, 2023 at 6:21 PM John Jason Jordan  wrote:

>
> >I don't know where those distros keep cron files.


they are kept in /var/spool/cron.

But, look first at
> >/etc/; there should be a set of cron directories there; e.g., cron.d/,
> >cron.daily/, cron.hourly/, cron.monthly/, cron.weekly/.
>
>
these are different from crontab. each has its own strengths and weaknesses.

-wes


Re: [PLUG] Move cron jobs to new computer

2023-09-28 Thread John Jason Jordan
On Thu, 28 Sep 2023 16:13:28 -0700 (PDT)
Rich Shepard  dijo:

>I don't know where those distros keep cron files. But, look first at
>/etc/; there should be a set of cron directories there; e.g., cron.d/,
>cron.daily/, cron.hourly/, cron.monthly/, cron.weekly/.
>
>Second, use the `slocate' command, a.k.a. `whois'. (`locate' should
>also work); e.g., `locate cron' will show all files with cron in their
>names.

Yeah, both distros have /etc/cron/daily folders, which is where
both cron jobs should be; they ran daily only. Most of the files are
identical between the two distros. None have my name on them or
anything that looks like it might be something that I produced. On
Xubuntu I originally had 20.04, then 22.04, so if the timestamp on a
file is before 2020 it couldn't be mine. But here's something that
makes no sense: In the cron/daily folder for Xubuntu there is a file
'brave-browser ... 9.27.2023.' WTH? The last time I booted to Xubuntu
was a week ago, for only a couple of hours, and the OS hasn't been run
since. My gast is flabbered.

The cron jobs were just one-liners in crontab, so an easier way to deal
with this would be to boot to Xubuntu, run crontab -e, copy the jobs to
a small text file somewhere accessible, then reboot to Sparky and paste
them into Sparky's crontab-e.


Re: [PLUG] Move cron jobs to new computer

2023-09-28 Thread Rich Shepard

On Thu, 28 Sep 2023, John Jason Jordan wrote:


My efforts worked perfectly for years, but now I'm migrating from Xubuntu
22.04.3 to SparkyLinux 7.0, and I'd like to migrate cron jobs in the
process. SparkyLinux automatically mounts / and /home from Xubuntu, so I
can just copy config files from the old OS to the new OS. However, I can't
figure out where cron on Xubuntu kept the jobs. They're in some config
file somewhere on those partitions, but where they are is a mystery. Can
someone give me a clue?


John,

I don't know where those distros keep cron files. But, look first at /etc/;
there should be a set of cron directories there; e.g., cron.d/, cron.daily/,
cron.hourly/, cron.monthly/, cron.weekly/.

Second, use the `slocate' command, a.k.a. `whois'. (`locate' should also
work); e.g., `locate cron' will show all files with cron in their names.

You can also use locate to find the names of the cron files you wrote.

HTH,

Rich


[PLUG] Move cron jobs to new computer

2023-09-28 Thread John Jason Jordan
Several years ago I created a couple shell scripts to make rsync create
mirrors of / and /home on another drive installed in the computer.
Although it took awhile I created cron jobs to run the scripts every
day at 3am and 4am.

My efforts worked perfectly for years, but now I'm migrating from
Xubuntu 22.04.3 to SparkyLinux 7.0, and I'd like to migrate cron jobs
in the process. SparkyLinux automatically mounts / and /home from
Xubuntu, so I can just copy config files from the old OS to the new OS.
However, I can't figure out where cron on Xubuntu kept the jobs.
They're in some config file somewhere on those partitions, but where
they are is a mystery. Can someone give me a clue?