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.
I had recently a system CRASH and was forced to reinstall KDE Neon Plasma from scratch. It took a couple of days to restore and reinstall some apps and it seems to all work OK now.
I am using the built in Task scheduler to run a Backup cron script to an external hard disk. This also works OK, but the script output of the end, DOES no longer show up, it creates an EMPTY log file on the desktop, below is the command line that used to work, but now doesn't.
usr/bin/rsync -a /home/alexe/afolders/ /media/alexe/Elements/$ldow/ >/var/tmp/anajob.out
Nor does this command:
/usr/bin/rsync -a /home/alexe/Desktop/ /media/alexe/Elements/$ldow/ > /home/alexe/Desktop/dback.txt
Is it possible you are remembering the command incorrectly?
'rsync -a' does not produce an output to screen, but 'rsync -av' does.
If $ldow has an assigned value before the command is run rsync would create or use the directory. If $ldow has no value then the copy would be created in /media/alexe/Elements/ . There would be no entry made in the logfile without the -v option since rsync runs silently unless there is an error (which would not appear in the log) or the -v (verbose) option is used.
Is it possible you are remembering the command incorrectly?
'rsync -a' does not produce an output to screen, but 'rsync -av' does.
If $ldow has an assigned value before the command is run rsync would create or use the directory. If $ldow has no value then the copy would be created in /media/alexe/Elements/ . There would be no entry made in the logfile without the -v option since rsync runs silently unless there is an error (which would not appear in the log) or the -v (verbose) option is used.
Hello,
Here is the complete script, yes that -av works, BUT it listed in the output 2036 lines of all the files that it copied. I used to get a single line of the action with date and time stamp....
Quote:
#get day of week
dow=$(/usr/bin/date "+%a")
# convert DOW to lower case i.e. Mon to mon
ldow=${dow,,}
Take out the redirect to the log file and run it a few times. You will see after the first run, all subsequent runs will have little or no output because rsync has already copied the data. Also you might throw a --delete to get rid of removed files and a real representation.
Take out the redirect to the log file and run it a few times. You will see after the first run, all subsequent runs will have little or no output because rsync has already copied the data. Also you might throw a --delete to get rid of removed files and a real representation.
Ok, but if i remove the redirect, what file will it be, where will it be located?
I am confused
Cheers
I think that suggestion to remove the redirect was so you can see on screen exactly what should be being written to the log file.
I used rsync to copy a directory tree and even with a large number of files the 'rsync -a' gave me nothing in the logfile. With -av it showed exactly what was copied.
After doing a backup that way IF you were writing to the same directory the -av would only display changes. Since you are creating a new directory each time it will always show the full list of files copied.
Copying all the files each time seems a major waste of time and resources when rsync takes care of only doing it as incremental when doing the backup into a previously used copy.
For example, I have about 5 TB of data and if I did a full backup each time it would take hours and a major amount of disk space for each backup. Since I do it as incremental it only takes a few minutes and the backup remains at the same size as the original, forever.
So I don't see a creation every run, sat dir would have sat, fri would have fri etc. But it would accumulate with deleted files and not a representation of a restore, that is why --delete. Yes, you would have everything, but if you stored a iso and then removed it, the image
would be your backup until you cleared it.
So using rsync in this manner at least not copy things already there and you could run it multi times a day and it would only copy updates. That is why I said don't use the redirect, the first time it copies everything and the next time nothing (or at least only the changes).
I think that suggestion to remove the redirect was so you can see on screen exactly what should be being written to the log file.
I used rsync to copy a directory tree and even with a large number of files the 'rsync -a' gave me nothing in the logfile. With -av it showed exactly what was copied.
After doing a backup that way IF you were writing to the same directory the -av would only display changes. Since you are creating a new directory each time it will always show the full list of files copied.
Copying all the files each time seems a major waste of time and resources when rsync takes care of only doing it as incremental when doing the backup into a previously used copy.
For example, I have about 5 TB of data and if I did a full backup each time it would take hours and a major amount of disk space for each backup. Since I do it as incremental it only takes a few minutes and the backup remains at the same size as the original, forever.
Well, I never sit there and watch the backup, I just want to look at the LOG from time to time to see that my backup works. Yes, it is incremental, each day of the week it goes into another folder with the abbreviated day name - sun,mon,tue etc... those folders are only created on the first run.
I used to have a log file that showed ONE single line per each dayly backup - that would be fine for me.
So, How can I get back that this setup?
Thanks again
So I don't see a creation every run, sat dir would have sat, fri would have fri etc. But it would accumulate with deleted files and not a representation of a restore, that is why --delete. Yes, you would have everything, but if you stored a iso and then removed it, the image
would be your backup until you cleared it.
So using rsync in this manner at least not copy things already there and you could run it multi times a day and it would only copy updates. That is why I said don't use the redirect, the first time it copies everything and the next time nothing (or at least only the changes).
My local storage device is only 512GB , my external drive is 3TB, I will not likely run out of space.
-v lists all the copied files.
--stats gives a summary line.
Code:
/usr/bin/rsync -a --stats ...
Hello,
I made the suggested change, what the log file has now is the following:
Code:
Number of files: 19,848 (reg: 16,178, dir: 3,670)
Number of created files: 2,091 (reg: 1,659, dir: 432)
Number of deleted files: 0
Number of regular files transferred: 1,664
Total file size: 24,699,946,665 bytes
Total transferred file size: 4,516,054,174 bytes
Literal data: 4,516,054,174 bytes
Matched data: 0 bytes
File list size: 393,194
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 4,517,819,136
Total bytes received: 48,137
sent 4,517,819,136 bytes received 48,137 bytes 81,403,013.93 bytes/sec
total size is 24,699,946,665 speedup is 5.47
I used to get a single line only, with date and time. Is there such an option?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.