Using APIs to develop backup applications
You can develop backup applications using APIs.
IBM® has supplied a set of subroutines that are useful to create backups or collect information about all files in a file system. Each subroutine is described in GPFS programming interfaces. These subroutines are more efficient for traversing a file system, and provide more features than the standard POSIX interfaces. These subroutines operate on a global snapshot or on the active file system. They have the ability to return all files, or only files that have changed since some earlier snapshot, which is useful for incremental backup.
- Create a global snapshot using the mmcrsnapshot command. For more information on snapshots, see the IBM Storage Scale: Command and Programming Reference Guide.
- Open an inode scan on the global snapshot using the gpfs_open_inodescan() or gpfs_open_inodescan64() subroutine.
- Retrieve inodes using the gpfs_next_inode() or gpfs_next_inode64() subroutine.
- Read the file data:
- Open the file using the gpfs_iopen() or gpfs_iopen64() subroutine.
- Read the file using the gpfs_iread(), gpfs_ireadx(), gpfs_ireaddir(), or gpfs_ireaddir64() subroutines.
- Close the file using the gpfs_iclose() subroutine.
The gpfs_ireadx() subroutine is more efficient than read() or gpfs_iread() for sparse files and for incremental backups. The gpfs_ireaddir() or gpfs_ireaddir64() subroutine is more efficient than readdir(), because it returns file type information. There are also subroutines for reading symbolic links, gpfs_ireadlink() or gpfs_ireadlink64() and for accessing file attributes, gpfs_igetattrs().