Displaying 16 results from an estimated 16 matches for "robust_renam".
Did you mean:
robust_rename
2004 Feb 17
1
[patch] Make robust_rename() handle EXDEV.
All callers of robust_rename() call copy_file() if EXDEV is received. This
patch moves the copy_file() call into robust_rename().
Patch Summary:
-12 +1 backup.c
-15 +2 rsync.c
-9 +33 util.c
-------------- next part --------------
patchwork diff util.c
--- util.c 2004-02-17 09:58:44.000000000 -0500
+...
2004 Feb 23
0
[patch] Add `--link-by-hash' option (rev 5).
...e --link-by-hash=DIR option, which hard links received
files in a link farm arranged by MD4 file hash. The result is that the system
will only store one copy of the unique contents of each file, regardless of
the file's name.
(rev 5)
* Fixed silly logic error.
(rev 4)
* Updated for committed robust_rename() patch, other changes in CVS.
(rev 3)
* Don't link empty files.
* Roll over to new file when filesystem maximum link count is reached.
* If link fails for another reason, leave non-linked file there.
* Depends on rsync-rename.diff
(rev 2)
* This revision is actually against CVS HEAD (I didn...
2004 Feb 23
0
[patch] Add `--link-by-hash' option (rev 4).
This patch adds the --link-by-hash=DIR option, which hard links received
files in a link farm arranged by MD4 file hash. The result is that the system
will only store one copy of the unique contents of each file, regardless of
the file's name.
(rev 4)
* Updated for committed robust_rename() patch, other changes in CVS.
(rev 3)
* Don't link empty files.
* Roll over to new file when filesystem maximum link count is reached.
* If link fails for another reason, leave non-linked file there.
* Depends on rsync-rename.diff
(rev 2)
* This revision is actually against CVS HEAD (I didn...
2004 Feb 17
0
[patch] Add `--link-by-hash' option (rev 3).
...= files->next;
+ kill_hashfiles(files);
+ return best;
+}
+
+
+int link_by_hash(char *fnametmp,char *fname,struct file_struct *file)
+{
+ STRUCT_STAT st;
+ char *hashname = make_hash_name(file);
+ int first = 0, rc;
+ char *linkname;
+ long last_fnbr;
+
+ if (file->length == 0) {
+ return robust_rename(fnametmp,fname);
+ }
+
+ if (do_stat(hashname, &st) == -1) {
+ char *dirname;
+
+ /* Directory does not exist. */
+ dirname = strdup(hashname);
+ *strrchr(dirname,'/') = 0;
+ if (do_mkdir(dirname, 0755) == -1 && errno != EEXIST) {
+ rprintf(FERROR, "mkdir %s: %s\n&q...
2003 May 21
2
patch to avoid race condition in rsync 2.5.6
...03-05-20 15:17:56.000000000 +0200
@@ -237,6 +237,9 @@
if (make_backups && !make_backup(fname))
return;
+ /* change permissions before putting the file in place */
+ set_perms(fnametmp,file,NULL,0);
+
/* move tmp file over real file */
if (robust_rename(fnametmp,fname) != 0) {
if (errno == EXDEV) {
@@ -253,7 +256,5 @@
fnametmp,fname,strerror(errno));
}
do_unlink(fnametmp);
- } else {
- set_perms(fname,file,NULL,0);
}
}
The call to set_per...
2002 Dec 05
1
Patch to ignore exluded files.
...@@ -236,13 +236,15 @@
> {
> if (make_backups && !make_backup(fname))
> return;
> + /* eric: set permisions before moving file */
> + set_perms(fnametmp, file, NULL, 0);
>
> /* move tmp file over real file */
> if (robust_rename(fnametmp,fname) != 0) {
> if (errno == EXDEV) {
> /* rename failed on cross-filesystem link.
> Copy the file instead. */
> - if (copy_file(fnametmp,fname, file->mode &
> INITACCESSPERMS))...
2003 Sep 05
1
new option suggestion '--backup-only'
...p_path_extfs = 0;
int failed;
+ int saveerrno;
while (keep_trying) {
- if (keep_path_extfs) {
+ if (keep_path_extfs || backup_only) {
failed = copy_file(src, dst, 0755);
+ saveerrno = errno;
if (!failed) {
do_unlink(src);
+ saveerrno = errno;
}
} else {
failed = robust_rename (src, dst);
+ saveerrno = errno;
}
if (failed) {
if (verbose > 2)
rprintf (FERROR, "robust_move failed: %s(%d)\n",
strerror (errno), errno);
+ errno = saveerrno;
switch (errno) {
/* external filesystem */
case EXDEV:
@@ -225,7 +231,8 @@...
2002 Jul 24
0
couple of minor fixes to rsync 2.5.5
...++ rsync.c Fri Jul 19 13:36:42 2002
@@ -236,13 +236,15 @@
{
if (make_backups && !make_backup(fname))
return;
+ /* eric: set permisions before moving file */
+ set_perms(fnametmp, file, NULL, 0);
/* move tmp file over real file */
if (robust_rename(fnametmp,fname) != 0) {
if (errno == EXDEV) {
/* rename failed on cross-filesystem link.
Copy the file instead. */
- if (copy_file(fnametmp,fname, file->mode &
INITACCESSPERMS)) {
+...
2003 Sep 03
1
[patch] replace dir with file error
...)) {
- rprintf(FERROR,"%s : not a regular file (recv_files)\n",fnamecmp);
- receive_data(f_in,NULL,-1,NULL,file->length);
+ if (fd1 != -1 && S_ISDIR(st.st_mode) && fnamecmp == fname) {
+ /* this special handling for directories
+ * wouldn't be necessary if robust_rename()
+ * and the underlying robust_unlink could cope
+ * with directories
+ */
+ rprintf(FERROR,"%s : is a directory (recv_files)\n",
+ fnamecmp);
+ receive_data(f_in, NULL, -1, NULL, file->length);
close(fd1);
continue;
+ }
+
+ if (fd1 != -1 && !S_IS...
2004 Jun 21
0
Problem found and fixed with --update
...if(cmp_modtime(target_st.st_mtime, file->modtime) > 0) {
+ rprintf(FINFO, "target \"%s\" newer, deleting \"%s\"\n",
+ fname, fnametmp);
+ do_unlink(fnametmp);
+ return;
+ }
+ }
+ }
+
/* move tmp file over real file */
+
ret = robust_rename(fnametmp, fname, file->mode & INITACCESSPERMS);
if (ret < 0) {
rprintf(FERROR, "%s %s -> \"%s\": %s\n",
--
=====================================================================
On Air Digital USA http://www.onairusa.com
Dallas,...
2004 Aug 09
1
race condition bugs
We're using rsync to update the tables on our email relays, and very
occasionally we get an error in the logs saying that a table has the wrong
permissions. This is because of race conditions in finish_transfer() which
mean that it does not update files atomically. This makes rsync not
entirely safe to use in our situation, where the files being synced are
frequently opened for short periods
2006 Jan 28
8
DO NOT REPLY [Bug 3461] New: rsync is not atomic when temp-dir is on different device
https://bugzilla.samba.org/show_bug.cgi?id=3461
Summary: rsync is not atomic when temp-dir is on different device
Product: rsync
Version: 2.6.7
Platform: Other
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P3
Component: core
AssignedTo: wayned@samba.org
ReportedBy:
2007 Dec 15
3
DO NOT REPLY [Bug 5147] New: Read-only files that have changed xattrs fail to allow xattr changes
https://bugzilla.samba.org/show_bug.cgi?id=5147
Summary: Read-only files that have changed xattrs fail to allow
xattr changes
Product: rsync
Version: 2.6.9
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P3
Component: core
AssignedTo: wayned@samba.org
2004 Apr 20
1
improved atime patch
...o));
return 0;
- }
+ } else {
updated = 1;
}
+ }
change_uid = am_root && preserve_uid && st->st_uid != file->uid;
change_gid = preserve_gid && file->gid != GID_NONE
@@ -236,7 +251,7 @@
return;
/* move tmp file over real file */
- ret = robust_rename(fnametmp, fname, file->mode & INITACCESSPERMS);
+ ret = robust_rename(fnametmp, fname, 0600);
if (ret < 0) {
rprintf(FERROR, "%s %s -> \"%s\": %s\n",
ret == -2 ? "copy" : "rename",
Index: rsync.h
=====================================...
2004 Apr 27
1
[PATCH] Inplace option for rsync
...ups;
+extern int inplace;
/*
@@ -235,6 +236,11 @@
if (make_backups && !make_backup(fname))
return;
+ if (inplace) {
+ set_perms(fname,file,NULL,0);
+ return;
+ }
+
/* move tmp file over real file */
ret = robust_rename(fnametmp, fname, file->mode & INITACCESSPERMS);
if (ret < 0) {
2001 Nov 13
2
direct write patch
I have attached a patch that supports a new "--direct-write" option.
The result of using this option is to write directly to the destination
files, instead of a temporary file first.
The reason this patch is needed is for rsyncing to a device where the
device is full or nearly full.
Say that I am writing to a device that has 1 Meg free, and a 2 meg file
on that device is out of date.