Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Each line, runs when executed in terminal, but the job itself doesn't.
So, I tried to use the Task app in KDE. I setup one single task, just to try. Please see screen shots for my setup, theerror I get when I try to run it manually and the 3rd image showing directory structure - no rsync folder, so - where is it?
Each line, runs when executed in terminal, but the job itself doesn't.
So, I tried to use the Task app in KDE. I setup one single task, just to try. Please see screen shots for my setup, theerror I get when I try to run it manually and the 3rd image showing directory structure - no rsync folder, so - where is it?
Hope someone will point out what is wrong here
Thanks
Alex
You path is not set properly from cron a common mistake I seem to remember seeing all the time.
Code:
root@haswell:~# which rsync
/usr/bin/rsync
A line should be for my setup using your folder structure.
You have the '/' after the source. /home/alex/afolders/ puts the backup into /media/alex/Elements/sun/afolders. The trailing slash makes a difference, as I've told you before. You want the contents of afolders copied, the individual files, not the directory itself. Remove that slash and see what happens.
HappyTux is correct. As mentioned in your other threads you need to set a PATH in your crontab or use absolute paths for all commands.
But
is not correct. The wild card is not needed to ensure everything under the source is synced. The -r option means recursive.
OK, I changed the cron job to look like this - just for today. I set the job at 9:45AM (Monday in Australia) to execute at 10:00 AM
HappyTux is correct. As mentioned in your other threads you need to set a PATH in your crontab or use absolute paths for all commands.
But
is not correct. The wild card is not needed to ensure everything under the source is synced. The -r option means recursive.
I was thinking that was what the -r was for. I was just thinking how I do it for similar, I like to make certain it is what I wanted done. Leaving no doubt that I want all the items in a directory copied to where I want them.
I was thinking that was what the -r was for. I was just thinking how I do it for similar, I like to make certain it is what I wanted done. Leaving no doubt that I want all the items in a directory copied to where I want them.
I am a disciplined soldier, this is what I did for a Monday backup:
In addition to what scasey has said it will fail with an option not found error for the rsync after the command /usr/bin/rsync. I would think so anyways. This will expect it to be the options being passed to the command. And now i think more about it there are no quotes around it to allow the passing of the -r too. It should be something like "/usr/bin/rsync -r" better off just using the /usr/bin/rsync with * on the items to be synced from the /home/alex/afolders/ part of it like I showed above. Then you are in no doubt at all what is going to be done with the command it will sync everything under that folder to the destination.
The second line cannot work. You cannot put the name of the executable twice back to back. Guaranteed to fail.
You have the same problem you started that long and painful thread with some time back. I'll bet dollars to donuts your files are in a subdirectory under sun, and mon, and so on. That trailing /, as in /home/alex/afolders/ guarantees that. It should be /home/alex/afolders - full stop. I've told you this many times, but if you want to use it, learn to look in the subdirectory underneath /media/alex/Elements/mon/, and the others. That mon subdirectory should have no files, just a subdirectory.
Well, with no absolute path for rsync originally, the cron job probably wouldn’t work...
The “double rsync” would have errored, as stated...so still no target.
The second line cannot work. You cannot put the name of the executable twice back to back. Guaranteed to fail.
You have the same problem you started that long and painful thread with some time back. I'll bet dollars to donuts your files are in a subdirectory under sun, and mon, and so on. That trailing /, as in /home/alex/afolders/ guarantees that. It should be /home/alex/afolders - full stop. I've told you this many times, but if you want to use it, learn to look in the subdirectory underneath /media/alex/Elements/mon/, and the others. That mon subdirectory should have no files, just a subdirectory.
The backup worked ok following my correction, removing extra rsync... The "mon" folder has inside it all the sub-folders from the source as intended.
One other question, what happens if at the intended job is to start, but the machine has gone to sleep? Will the job start when I wake it up?
The backup worked ok following my correction, removing extra rsync... The "mon" folder has inside it all the sub-folders from the source as intended.
One other question, what happens if at the intended job is to start, but the machine has gone to sleep? Will the job start when I wake it up?
Thanks again
Alex
Nothing it waits until the next day to run, install anacron to get it working all the time when a machine wakes up.
Code:
root@haswell:~# apt show anacron
Package: anacron
Version: 2.3-28
Priority: optional
Section: admin
Maintainer: Debian QA Group <packages@qa.debian.org>
Installed-Size: 101 kB
Depends: debianutils (>= 1.7), lsb-base (>= 3.0-10), libc6 (>= 2.7)
Recommends: cron | cron-daemon, rsyslog | system-log-daemon
Suggests: default-mta | mail-transport-agent, powermgmt-base
Replaces: pe
Homepage: http://sourceforge.net/projects/anacron/
Tag: admin::automation, implemented-in::c, interface::daemon, role::program,
scope::utility
Download-Size: 34.6 kB
APT-Sources: http://ftp.de.debian.org/debian buster/main amd64 Packages
Description: cron-like program that doesn't go by time
Anacron (like "anac(h)ronistic") is a periodic command scheduler. It
executes commands at intervals specified in days. Unlike cron, it
does not assume that the system is running continuously. It can
therefore be used to control the execution of daily, weekly, and
monthly jobs (or anything with a period of n days), on systems that
don't run 24 hours a day. When installed and configured properly,
Anacron will make sure that the commands are run at the specified
intervals as closely as machine uptime permits.
.
This package is pre-configured to execute the daily jobs of the
Debian system. You should install this program if your system isn't
powered on 24 hours a day to make sure the maintenance jobs of other
Debian packages are executed each day.
One other question, what happens if at the intended job is to start, but the machine has gone to sleep?
It depends on what you mean by sleep. Exactly what is in the power manager configuration? It could just kill the display, suspend, hibernate, or something else. Sleep is an imprecise term here.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.