[solved] Did rsync behaviour change? (= nope, not here at least )

Hi!
I just used one of my "full system backup" hd's and the backup script on it deleted all the backups and itself (still made a current backup, just the incremental ones are gone now) -.-
I didn't use that script from the hd for a while (didn't have changes in big files for almost a year, so I only pushed my home folder to the router hd every day), but back when I was working with big files more, I used it every second day for several years and it always worked reliably.
That being said: My guess would be, that it deleted the "excluded=" folders, which is shouldn't (?) or didn't use to with --delete (the hd root was a clone of my system root, except for one excluded /BACKUP directory that kept the increments from --backup). Can't see any other way.
Did anyone notice a change in rsync behaviour? Anything strange?
Couldn't find anything anything on the net that fits... but I almost remember having fixed something rsync-related somewhere... some time ago... not sure what/if/why though, maybe just déjà-vue...
I have some more distributed rsync scripts and might have to check after a lot of things if there's really been a change in rsync behaviour...
( Please excuse the general fuzzyness of this question/topic... I'm in the middle of one of those weird fits of "I should have made a backup before I started that backup now I need to check EVERYTHING and the server too and omg when was the last time I even ssh'd into the router and looked at the cronjobs!?" )
Last edited by whoops (2015-01-31 09:55:19)

\hbar wrote:I don't get it: I see a hyphen before the options. Was it edited?
yes, sorry,  it probably wasn't clear...:
whoops wrote:Oh, thanks, that was a hasty copy paste error (was scared of the --delete ), fixed it now.
... what exactly I "fixed" there. Should have re-posted the line instead of editing the old post .
\hbar wrote:Anyways, it seems to me that */BACKUP/* would not exclude /BACKUP : the /* files you are sync-ing get expanded into their names, one of which would be 'BACKUP' which does not (and should not) match '*/BACKUP/*'
Hmmm, right, "/BACKUP" should definitely be in there too just to be safe, thanks!
There also shouldn't have been a /BACKUP in the first place, though. Here's a more recent version of the whole script that I found on a different backup drive in the meantime (the one that caused the trouble should be almost identical):
#!/bin/bash
# check if root
[ -d /BACKUP ] && { echo "TRYING TO RUN SCRIPT ON WRONG DRIVE?"; exit 1; }
[ -f /backupthis ] || { echo "NOPE! This drive does not want to be backed up ('/backupthis' missing)"; exit 1; }
# find backup drive marker file
while read mount;
do
if [ -a "$mount/BACKUP/backupdriveisabove" ];
then echo $mount;
backup_drive=$mount;
fi;
done < <(mount | grep /media | sed "s/.*on \(.*\) type.*/\1/")
# check if marker file is fine - should match:
# directory="/media/BACKUPMOUNT"; blkid $(mount | grep "$directory") | sed 's/.*: //' > $directory/BACKUP/backupdriveisabove
grep "$(blkid $(mount | grep $backup_drive) | sed 's/.*: //')" "$backup_drive/BACKUP/backupdriveisabove" \
|| { echo "$backup_drive is not a valid backup drive." ; exit 1; }
echo -e "\E[32m===== Backup drive found in $backup_drive =====" && tput sgr0
# Help! I'm scared!
for countdown in `seq 0 5`; do echo "death and destruction in `expr 5 - $countdown`"; sleep 1; done;
# Rsync stuff of which incremental backups should be kept in ./BACKUP/$(date +%Y-%m-%d) first
echo -e "\E[32m===== Partial incremental backup =====" && tput sgr0
synctime=1337
while (( $synctime > 15 ))
do statime=$(date +%s);
rsync -aAXvxbiH /* \
$backup_drive --backup-dir=$backup_drive/BACKUP/$(date +%Y-%m-%d) \
--log-file="$backup_drive/BACKUP/$(date +%Y-%m-%d).log" \
--exclude-from="/opt/scripts/backup.exclude" \
--delete --fuzzy \
|| { echo 'incremental backup failed' ; exit 1; }
eval synctime=`expr $(date +%s) - $statime`
if (($synctime > 14)); then echo "rsync took too long ($synctime) - repeating"; fi;
done;
# Rsync (almost all) previously excluded files / nonincremental full backup to backup drive root
echo -e "\E[32m===== Full system backup =====" && tput sgr0
rsync aAXv /* "$backup_drive" --exclude={share/Trash/*,/dev/*,/proc/*,/sys/*,/tmp/*,/tmp/.*,/run/*,/mnt/*,/media/*,/lost+found,/home/*/.gvfs,*/BACKUP/*,/home/*/.ccache/*,/home/*/.thumbnails/*,/var/tmp/*,/home/*/.mozilla/firefox/*.default/Cache/*,/home/*/.mozilla/firefox/*.default/thumbnails/*,/home/*/.pulse/*,/home/_*,*.part} \
|| { echo 'full backup failed' ; exit 1; }
# Try to merge two old backup increments without making too big a gap (if there are more than 60 backups)
echo -e "\E[32m===== Trying to merge 2 backup increments =====" && tput sgr0
minnamecur=0;
treshold=$(ls -d $backup_drive/BACKUP/2???-??-?? | wc -l);
if (($treshold > 60))
then {
treshold=`expr $treshold / 3`
# Do not create gaps between incremental backups that would be bigger than this many seconds
mingap=$[60*60*24*30]
pushd "$backup_drive/BACKUP" || { echo 'incremental backup folder not found' ; exit 1; }
c=0
# find backup that would leave the smallest gap
for dir in 2???-??-??;
do c="`expr $c + 1`";
dirsec=$(date -d "$dir 00:00" +%s)
eval name_$c=$dirsec;
if (($c > 4)) && (($mingap > 86399));
then {
cpre="`expr $c - 4`";
ccur="`expr $c - 3`";
cnex="`expr $c - 2`";
eval namecur=\$name_$ccur;
eval namepre=\$name_$cpre;
eval namenex=\$name_$cnex;
gap=`expr $namenex - $namepre`;
if (("$gap" < "$mingap"))
then {
mingap="$gap"
export minnamecur="$namecur"
export minnamenex="$namenex"
daysgap=`expr $mingap / 86400`
} fi;
# reduce acceptable gap size for newer backup increments depending on amount of backups
gapreduce="`expr $mingap / $treshold`";
mingap="`expr $mingap - $gapreduce`";
# echo "DEBUG: $c -- Folder $namecur -- acceptable gap size reduced to: $daysgap days";
} fi;
done;
# merge 2 backup increments / remove the old one.
if (( $minnamecur > 2000 ))
then {
eval rmback=$backup_drive/BACKUP/$(date -d "@$minnamecur" +"%Y-%m-%d");
eval toback=$backup_drive/BACKUP/$(date -d "@$minnamenex" +"%Y-%m-%d");
cp -vlrTf $toback $rmback &&\
rm $toback -rv &&\
mv -v $rmback $toback &&\
echo -e "\E[32m===== moved $rmback to $toback, resulting gap: $daysgap days =====" && tput sgr0
} else echo "Could not find Folder to delete. Maybe gaps between backups are too big already."
fi;
} fi;
popd
# install grub to backup-drive
echo grub-install $(mount | grep $(stat -c%m "$backup_drive") | sed "s/[0-9].*//")
# unmount the backup drive :3
umount $backup_drive -v \
|| { echo "Something might have gone horribly wrong but now it's too late to do anything about it :D" ; exit 1; }
From what I can tell, the only way this can has happened is if somehow /BACKUP got created while the script was already running? Or is there another way that I can't see?
Have to retrace my steps...
1) Wanted to make a backup of my project in kdevelop with the builtin git function. When I pressed the "git button" in kdevelop, it crashed and all source files of the project were deleted.
2) temporarily killed git & other backup solutions. Tried to restore files with git manually, but there were no deleted files registered / all commits were empty for some reason.
3) I connected a SPARE_HD and dumped /dev/sda2 (my swap) to it (used a lot of ram so I hoped the source files were in there)
4) Connected OLD_BACKUP_HD in addition to SPARE_HD and started backup script ("just in case")
5) used extundelete to recover everything deleted withing the last 2 hours to the SPARE_HD
6) Started '# strings /sda | grep -n600 "Text that I luckily had in the first line of all my lost files" > /SPARE_HD/big_text-file'
7) Started rummaging trough the stuff that extundelete recovered on the SPARE_HD to see if anything's missing (only 2 of the deleted files were unrecoverable)
8) Started rummaging trough /SPARE_HD/big_text-file with grep, found the last 2 files I was missing in there (HUZZAH!)
9) Looked at my OLD_BACKUP_HD and saw it had deleted its own incremental BACKUP folder plus itself and its logs...
Hmmm, I can totally not see myself creating /BACKUP there somewhere between step 4 and 9 because during that time I tried to avoid writing ANYTHING to /dev/sda, but I don't see another way this could have happened, so I guess I must have done it anyway -.-
*sigh* Maybe it's time to retire that thing... even though it had a pretty good run (several years on several mostly unsupervised machines including a webserver and a router - and no problems)...
And HOW is it possible that EVERY SINGLE time I loose files it's because something goes wrong with an attempt to make a BACKUP?
The only reason why I even need backups seems to be that I keep deleting files while trying to make backups (even if for a change I don't use any messy self-written scripts) and then I end up doing "good old messy file recovery" instead anyways -.-
Last edited by whoops (2015-01-31 08:32:59)

Similar Messages

  • My daughter has created an imovie for a school project, last time she did this and downloaded it onto her memory stick the teach could not play it on their windows pc, how do we convert it or change it so the teacher can play.  thank you

    my daughter has created an imovie for a school project, last time she did this and downloaded it onto her memory stick the teach could not play it on their windows pc, how do we convert it or change it so the teacher can play.  thank you

    Meg\'s Dad wrote:
    …  I assume this format is what is needed to play on the class "Smart Board" also? …
    here in ol' Europe, school boards use chalk and are not smart …
    h264.mp4 is actually the most common 'standard' (4000 video 'standards' aaaaand counting)
    mp4 is indeed universal (Mac, Windows, Linux), and since YouTube, the h264 codec has a good installed base .....
    you can bump into probs only when it comes to sheer amount of data:
    for instance cheap 'digital frames' are sortof over-whelmed, if you try to playback 720/30p in high quality.
    I'm not familiar with 21st cent devices as SmartBoards ... again, it could happen, you have to reduce resolution/fps/bit-rate to avoid clutter&stutter in the video.
    I'm using such encoded files successfully on Playstation3, WD HD TV or flatscreenTVs with integrated usb-connection (via stick), etc
    imho, it should work welll .............. < fingers-crossed >

  • Upon startup Firefox says "Proxy is refusing connections." When I select "Auto-Detect Proxy" from Advanced settings and solve problem, changes are not saved and upon next startup I must select again...!

    Firefox 4 was working fine. Then one day, when I started up Firefox, it says "Proxy is refusing connections." I solved this by selecting "Auto-Detect Proxy" from Advanced network settings, but my changes are not saved and upon every start-up I must select it again! (I even completely removed my webroot antivirus protection, as it as hindering many proxy related programs, but this seems to not be the source of the problem)

    You can find the connection settings in Tools > Options > Advanced : Network : Connection
    If you do not need to use a proxy to connect to internet then select "No Proxy"
    See "Firefox connection settings":
    * https://support.mozilla.com/kb/Firefox+cannot+load+websites+but+other+programs+can
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes
    See also:
    *http://kb.mozillazine.org/Preferences_not_saved

  • I work for the County and we purchased a copy of Adobe Photoshop CS2 long ago.  The person that did the order is no longer here.  All I have is the CD Disk that is new but i did not know the key code is.  Is there a way to get the keycode for this?

    I work for the County and we purchased a copy of Adobe Photoshop CS2 long ago.  The person that did the order is no longer here.  All I have is the CD Disk that is new but i did not know the key code is.  Is there a way to get the keycode for this?

    It would not work anyway. The activation servers have been retired and Adobe has provided a new CS2 download along with a new serial number for CS2 owners.
    Download Acrobat 7 and CS2 products
    Gene

  • HT5621 i could not update my applications since the account that applied was when i was in the US...it says that i needed to change itunes store here in the philippines and how do i do that?

    i could not update my applications since the account that applied was when i was in the US...it says that i needed to change itunes store here in the philippines and how do i do that?

    Click here and follow the instructions to change the iTunes Store country.
    (87167)

  • HT2237 what is Error code -8076 get it when changing read/write permissions on an iTunes music folder. I did google it but could not find

    get it when changing read/write permissions on an iTunes music folder. I did google it but could not find anything???

    get it when changing read/write permissions on an iTunes music folder. I did google it but could not find anything???

  • While playing my albums in iTunes it has just started playing the first song but will not progress through the other songs on the album. Did I accidentally change setting or are other people having the same trouble? thanks

    While playing my albums in iTunes it has just started playing the first song but will not progress through the other songs on the album. Did I accidentally change setting or are other people having the same trouble? thanks

    Hi there Sing Me A Song,
    You may have changed the Up Next list in iTunes. Take a look at the article below for more information on the Up Next lists and how to edit it.
    iTunes 12 for Mac: Play songs
    -Griff W. 

  • Ipod touch just lost all wi-fi capabilities. full new ipod restore did nothing to change it, can't retype passcodes etc because it does not even find any wireless network to join. thoughts?

    ipod touch just lost all wi-fi capabilities. full restore as new ipod did nothing to change it. I cannot enter pass codes etc because there are no wi-fi networks found to join, despite other apple devices finding my wireless just fine, all sitting at same desk (and the airplane mode is off). thoughts?

    Is this your problem?
    iOS: Wi-Fi or Bluetooth settings grayed out or dim
    This is frequently a hardware problem and an appointment at the Genius Bar of an Apple store is in order.

  • Not here! Region Tie Regions by Position Change (Logic9)

    I have just upgraded to Logic9 and am looking though the new style instruction manual.
    On the 'Adding or Removing Arrangement Passages' page at the 'remove gaps between regions' part it says Choose Region > Tie Regions by Position Change (or use the Tie Regions by Position Change key command).
    The thing is, that the 'Tie Regions by Position Change' is not under the local menu Region and the KC
    is no where to be found either. Has anybody else seen this at all.
    There is the option 'Trim Regions etc' under Regions though no Tie Regions.
    Thanks
    Message was edited by: ekaton
    Message was edited by: ekaton

    Must be Region > Shuffle Regions left within selection then

  • Changes are not refreshing at runtime

    hi friend,i made some changes in the mapping Object in system A and then transported the changes to System B.
    in system B ...transported objects are activated and it shows activated in history of transport objects....up to here everything going fine.
    but in runtime....the changes are not getting reflected.....
    can u tell the reasons where it fails and how to solve this issue.....
    Best Regards,Saran

    looks like a version conflict to me,just check if you are having any issues due to wrong versions.
    http://help.sap.com/saphelp_nw04/helpdata/en/47/65993f7717fb47e10000000a114084/frameset.htm
    Thanx
    Aamir

  • Cardinality changes are not reflecting inbound proxy

    Hi Experts,
    while doing a syncronous senario in BPM with inbound proxy. i was required to change the cardinality from the existing request(source)  structure in inbound service interface,
    once i did the cardinality changes in the request(source) External definition,i could able to see the changes in PI. Then proxy is regenarated to see the new changes of the cardinality. But it reflects to the both input(request) and output(response) of the inbound proxy structure cardinality.
    Please help in this regard.
    Regards,
    Sasi

    Hi Vijaya,
    Thanks for your input, i did the same,but still its not reflecting in the output structure of the inbound proxy.
    Please provide some input to solve this issue.
    Regards,
    Mahakrishnan T.

  • Shopping Cart Workflow - "Wait for change event" not firing?

    Hi there,
    I have a scenario where if I create a shopping cart above my spending limit it will go into the approver's inbox, that is fine.
    Now if I change the total value of the shopping cart to be within my spending limit the original workflow should be "logically deleted" and a "no step approval workflow" should be triggered.
    I see when the SC workflow triggers it also branches with a "wait for events", so that if it changes etc it will get caught here.
    When I change the SC it does not do anything, the value of the cart changes but it still sits in the approvers inbox and the "no step approval workflow" does not trigger.
    We are busy upgrading to SRM 5.0, it worked perfectly in the SRM 3.0 system we had.
    Any ideas what would cause the "change event" not to fire?
    Thanks for the help
    Lynton

    Hey Masa,
    You are the man!! That solved it.....I have implemented the BBP_WFL_SECUR_BADI and for whatever reason I set the security level to 4 when it should have been 2.
    4     "High" (workflow is never restarted when changes are made)
    3     "Medium" (WF restarted conditionally when changes are made)
    2     "Low" (workflow is always restarted when changes are made)
    1     "None" (changes to the object are not allowed)
    0     "Not defined"
    Thanks for the help
    Lynton

  • Component binding - changes are not reflected

    Dear all,
    When using JSF method binding I'm experiencing the following strange behavior.
    Within the view, I'm registering a panel by method binding expression, which I then use within the controller bean to add additional UIComponents on it. However when running through "addTestToDEBUG()", the existing Panel is retrieved properly via the getViewRoot's children, the new HtmlOutputText is created and added upon - also when I call getComponent on the newly created HtmlOutputText's userID I get the UIComponent returned.
    However after the addTestToDEBUG() method has finished and the view is updated, the "setComponentPanelDEBUG(UIComponent panel)" is called, but panel (where we have added child UIComponents upon, does not contain the HtmlOutputText element!
    Where's my conceptional error? Thanks for your help!
    Please find attached my sample code:
    here's my view:
    <h:form id="formXmlDebugTemplate">
         <p><h:outputText value="Debugging:"/></p>
         <h:panelGroup id="panelDEBUG" binding="#{RegisterTBServiceBean.componentPanelDEBUG}">               </h:panelGroup>
         <br/>  
          <h:commandButton id="buttonDEBUG" value="Add Element" action="#{RegisterTBServiceBean.command_addDEBUGITEM}"/>     
    </h:form>here's the bean:
    private UIComponent debug = new UIPanel();
    public UIComponent getComponentPanelDEBUG(){
         return this.debug;
    public void setComponentPanelDEBUG(UIComponent panel){
         this.debug = panel;
    }here's the controller
    public void addTestToDEBUG(){
         UIComponent panel = (UIComponent)getComponent("formXmlDebugTemplate:panelDEBUG");
         String sRandom = ((int)((java.lang.Math.random()*100)))+"";
         facesContext = FacesContext.getCurrentInstance();
         HtmlOutputText outputText = (HtmlOutputText) facesContext.getApplication().createComponent(HtmlOutputText.COMPONENT_TYPE);
         outputText.setValue("Test"+sRandom);
         outputText.setId("xmlDEBUGOutputText"+sRandom);
         panel.getChildren().add(outputText);          
    private UIComponent getComponent(String sID){
         facesContext = FacesContext.getCurrentInstance();
         Iterator<UIComponentBase> it = facesContext.getViewRoot().getChildren().iterator();
         UIComponent returnComp = null;
         while(it.hasNext()){
              UIComponent guiComponent = it.next().findComponent(sID);
              if(guiComponent!=null){
                   returnComp = guiComponent;
         return returnComp;
    }

    Dear all, thanks for your help - we've finally found what was causing the problems:
    So the behaviour was that actually all "method bound" UIComponents were updated within the bean, but the changes were not reflected within the gui.
    Well *<redirect>* within the faces-config was causing the problems
    Redirect foces a HTTP redirect instead of using the usual ViewHandler mechanism to take place.
    kr A.

  • Battary from the laptop was not her turn

    The laptop was plugged into the socket. I staked the adapter from the socket, the screen become black. although I did everything gently, I could not start the laptop. when I press the power button LED lights up very quickly and out but the screen remains black. my laptop has no warranty. what should I do? how can I fix this problem?

    Sasi,
    There are many different g6's, so that is not the product number.  I'd suggest calling in and speaking to a live rep, since you should still be in warranty if you purchased new.
    If you live in the US, contact HP Here.
     If you are in another part of the world, begin Here.
    Good luck!
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

  • Termstore changes are not getting reflected in the list items in SharePoint 2010 farm environment

    Hi,
    I had created managed metadata with termstores from central admin. Then I had created one list in which added a column of type managed metadata using the managed metadata which I had created. And also added few list items to this list.
    The problem is that after updating a termstore the changes are not reflecting in the list items which were added before the update.
    I have referred the following links:
    http://www.paulgrimley.com/2011/02/managed-metadata-changes-not-applied-to.html
    http://davidfrette.wordpress.com/2010/05/26/taxonomy-update-scheduler%C2%A0timer%C2%A0job/
    According to the links we need to run Taxonomy Update Scheduler on the server for updated termstore to get reflected. After running
    this scheduler on development environment changes are getting reflected but not working on the production environment.
    Kindly help!
    Regards, Shruti

    You should check the obvious.  You made the change in dev, but did you make the change in production too?  And, is the term you updated, actually the one that you are looking at in the list item?
    There is not much, if anything, that can go wrong with that timer job. so I'd guess that the term you are looking at is not the one you think you are updating.
    If you have double checked everything (the term is is in fact the same term id), then you may have something erroring in the update process.  In this case, you should check the ULS logs for any errors.
    Chris
    Chris Givens CEO, Architecting Connected Systems
    Blog Twitter

Maybe you are looking for