sync(2) System Calls sync(2)NAME
sync - update super block
SYNOPSIS
#include <unistd.h>
void sync(void);
DESCRIPTION
The sync() function writes all information in memory that should be on disk, including modified super blocks, modified inodes, and delayed
block I/O.
Unlike fsync(3C), which completes the writing before it returns, sync() schedules but does not necessarily complete the writing before
returning.
USAGE
The sync() function should be used by applications that examine a file system, such as fsck(1M), and df(1M), and is mandatory before
rebooting.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO df(1M), fsck(1M), fsync(3C), attributes(5), standards(5)SunOS 5.10 5 Jul 1990 sync(2)
Check Out this Related Man Page
SYNC(2) BSD System Calls Manual SYNC(2)NAME
sync -- synchronize disk block in-core status with that on disk
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <unistd.h>
void
sync(void);
DESCRIPTION
The sync() function forces a write of dirty (modified) buffers in the block buffer cache out to disk. The kernel keeps this information in
core to reduce the number of disk I/O transfers required by the system. As information in the cache is lost after a system crash, kernel
thread ioflush ensures that dirty buffers are synced to disk eventually. By default, a dirty buffer is synced after 30 seconds, but some
filesystems exploit ioflush features to sync directory data and metadata faster (after 15 and 10 seconds, respectively).
The function fsync(2) may be used to synchronize individual file descriptor attributes.
CAUTIONS
Many modern disks contain write-back caches. In theory sync() flushes these. In practice there are many possible ways for this mechanism to
go astray. It is prudent (where possible) to allow a few seconds after syncing for everything to settle before e.g. turning off the power.
It may also be desirable to use dkctl(8) or scsictl(8) to disable the write-back cache entirely.
SEE ALSO fsync(2), dkctl(8), scsictl(8), sync(8)HISTORY
A sync() function call appeared in Version 6 AT&T UNIX.
Historically, sync() would schedule buffers for writing but not actually wait for the writes to finish. It was necessary to issue a second
or sometimes a third call to ensure that all buffers had in fact been written out. In NetBSD, sync() does not return until all buffers have
been written.
BSD March 25, 2009 BSD
I have a directory called sync and the directory path is ftp/exports/sync. What I would like to do is place some documents in sync for external users to view and would like to have access restriction for the sync directory. i.e. login and password. How do I go about doing this in a Unix enviorment.... (3 Replies)
Hello
It appears that on a regular basis, perhaps when weekly rebooting happens, not sure yet, my odm becomes out of sync.
When doing a smitty file system list by volume group, the FS type is displayed as ??? on several FSs. Always in the same VG.
I know how to fix this problem, thing is,... (4 Replies)
Can anyone could tell me what is the meaning of this problem:
Last successful check resync is greater than min sync interval (1195785433 > 7200)
And what can do to solve this problem.
Thank you..Please HElp me! (4 Replies)
Hi,
I need to sync 2 remote folders so i setup with rsync which is working very fine. But, there comes another requirement to maintain multiple versions of files on destination (NOT to overwrite the destination file).
If there is difference between source file and destination file, it must... (2 Replies)
Gentle readers,
I am trying to observe system behavior on our RHEL 5.2 machines. I notice that, it appears to me, based on random iterations of
dd if=/dev/zero of=/var/tmp/bigfile bs=1024 count=20000
...that if the pdflush is flushing buffers at the time of my write, my write will take... (4 Replies)
I have a directory called UNIX 1 which contains 2 files and uploaded into two different servers. Now I want to check whether the directory contains both the files. If not, then need to sync the directory.
Please let me know how to do that in shell scripting. (2 Replies)
Hi all,
I am trying to create a simple password script but it seems not working well.
What I'm trying to do is to sync the yppasswd and smbpasswd. So I created this:
#!/bin/csh
echo ""
echo "Please enter old password: "
set OLDPASSWD = $<
echo "Please enter new password: "
set NEWPASSWD... (2 Replies)
Anyone know how to go about skipping the initial disk sync of a newly created drbd resource?
I'm creating brand new 30gb partitions and would like to skip the entire initial sync, I've read this is possible but I cannot seem to find the instructions to do it.
Thanks,
Trey (2 Replies)
Hi All,
want to sync. two servers , both are having solaris os.
If am updating any thing in one server , it will automatically sync. with the other server .
Is it possible , if so den how ? (3 Replies)
I have a VirtualBox w2008r2 Domain Controller running on a Solaris 10 server. I have the time on the Virtual machine set to Default time sync (bios clock) and the Solaris server set to sync to
0 8,20 * * * /usr/sbin/ntpdate tick.usno.navy.mil tock.usno.navy.mil >> /tmp/ntp.log
My problem is... (2 Replies)
So right now I am trying to sync an iPhoto Library file from multiple computers.
The goal being that it takes the most recently updated file (depending on which computer it was). Currently I am using Google Drive to essentially sync the newest library, however, I was curious to see if this was... (1 Reply)
Guys can anyone tell how can we do faster disk cloning
Below i found in google
1. dd if=/dev/sda of=/dev/sdb bs=4096 conv=noerror,sync
So adding "conv=noerror,sync " makes it faster looks against not adding it
2. Enable write cache activated (hdparm -W1 /dev/sda) then run dd ..
... (2 Replies)
Hi,
I would like to achieve below requirement,
I have a directory "/mydir" and I want to automatically sync/copy all the content of /mydir directory to "/yourdir" directory all the time.
meaning, if some application creates a file in /mydir, it supposed to be copied/available in "/yourdir"... (4 Replies)
Hi All,
I deployed the rhel7 server in the bare metal hardware. I want to configure the rhel7 server to sync time with bios. I tired the below commands. Still it did not sync the time with bios.
Thanks,
Kalai (3 Replies)
statement 1 :
I see everyone saying Unix follows a tree like hierarchial structure.
Statement 2:
Unix file system has four blocks
1.boot block
2.super block
3.inodes
4.data block
My question is , in which of the above four blocks , the hierarchial structure comes.?? How could we corelate... (2 Replies)